.Net Core Win2008R2 运行环境问题 502.5

时间:2022-10-22 00:13:53

运行环境下载地址

1、安装SDK  

2、安装Runtime 

3、安装win2008R2 专用补丁  Windows6.1-KB2999226-x64   win2012的似乎是Windows8.1-KB2999226-x64

4、以上重启

5、iis  应用无托管代码,检查模块aspnetcoreModeule 完成。 

6、浏览器浏览仍然提示502.5,选择直接运dotnet  run也显示运行失败!!

执行:cmd  dotnet  程序.dll。提示:

D:\weixin.cnepaper.com>dotnet  Aheading.BDA.API.App.dll
Error:
  An assembly specified in the application dependencies manifest (Aheading.BDA.A
PI.App.deps.json) was not found:
    package: 'Microsoft.AspNetCore.Mvc.Abstractions', version: '2.0.2'
    path: 'lib/netstandard2.0/Microsoft.AspNetCore.Mvc.Abstractions.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.5.xml

解决方案

7、需要再项目文件 .csproj 中添加如下代码,之后重新生成。

<PropertyGroup>               
    <PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
</PropertyGroup>

8、dotnet  run  运行成功!

9、iis 网站运行也成功!