net core 2.0网站发布到 centos7 上运行报错
[root@localhost test]# ls
WebApplication1.PrecompiledViews.dll WebApplication1.deps.json WebApplication1.pdb appsettings.Development.json bundleconfig.json wwwroot
WebApplication1.PrecompiledViews.pdb WebApplication1.dll WebApplication1.runtimeconfig.json appsettings.json web.config
[root@localhost test]# cd WebApplication1.dll
-bash: cd: WebApplication1.dll: Not a directory
[root@localhost test]# dotnet WebApplication1.dll
Error:
An assembly specified in the application dependencies manifest (WebApplication1.deps.json) was not found:
package: 'Microsoft.AspNetCore.Antiforgery', version: '2.0.1'
path: 'lib/netstandard2.0/Microsoft.AspNetCore.Antiforgery.dll'
This assembly was expected to be in the local runtime store as the application was published using the following target manifest files:
aspnetcore-store-2.0.3.xml
[root@localhost test]# dotnet --version
2.0.0
[root@localhost test]#
Linux 上的dotnet 版本
vs2017的dotnet 版本
centos 上安装的 .net core sdk 版本不对,需要安装 2.1.4
sudo yum update
sudo yum install libunwind libicu
sudo yum install dotnet-sdk-2.1.4
解决了