首页 新闻 会员 周边 捐助

net core 2.0网站发布到 centos7 上运行报错

0
悬赏园豆:10 [已解决问题] 解决于 2018-03-08 22:18

 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 版本

TNNKZzz的主页 TNNKZzz | 初学一级 | 园豆:177
提问于:2018-03-08 21:19
< >
分享
最佳答案
0

centos 上安装的 .net core sdk 版本不对,需要安装 2.1.4

sudo yum update
sudo yum install libunwind libicu
sudo yum install dotnet-sdk-2.1.4
收获园豆:10
dudu | 高人七级 |园豆:30948 | 2018-03-08 22:10

解决了

TNNKZzz | 园豆:177 (初学一级) | 2018-03-08 22:18
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册