我知道我们能够将 .Net Core 3.x 控制台应用程序发布为自包含
、单个文件
。但是否可以将 Web 应用程序发布为单个文件?
我试过
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<PublishReadyToRun>true</PublishReadyToRun>
<PublishSingleFile>true</PublishSingleFile>
但是在发布之后我得到了错误ANCM Application DLL Not Found
。我的应用程序在 .Net Core 3.1.1
上运行。
我该怎么做?
最佳答案
你应该编辑你的 webconfig 看起来像
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
代替
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
关于c# - 是否可以将 ASP.Net Core 3.1 Web 应用程序发布为单个文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59989534/