.NET CORE开发的应用发布到 IIS,应用程序池设置为 无托管代码 后,浏览报 502 错误,如下图

HTTP Error 502.5 - Process Failure

已经安装了 DotNetCore.2.0.5-WindowsHosting 了,使用命令 dotnet C:\应用目录\应用文件.dll  执行,提示

An assembly specified in the application dependencies manifest <应用文件.deps.json> was not found:

package: 'Microsoft.AspNetCore.Antiforgery' , version:'2.0.2'

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.6.xml

百度查 关键词 core  Microsoft.AspNetCore.Antiforgery 搜索到要安装 dotnet-sdk-win-x64

下载地址 https://www.microsoft.com/net/download/windows#/runtime

安装后,终于不报上面的错误了,但是出现了新错误

An error occurred while starting the application

.NET Core 4.6.26328.01 X64 v4.0.0.0


再次执行命令 dotnet C:\应用目录\应用文件.dll,提示 Autofac.Core.DependencyResolutionException,一句话 Could not find file 'C:\应用目录\应用文件.xml'

这个是因为 使用了 swagger 组件,在项目属性里配置输出就好了,如下图