【发布时间】:2020-11-13 03:29:21
【问题描述】:
我这里有个情况。我将发布我的“测试”.net 核心应用程序之一(.net 核心 3.1)以查看 Azure 平台的工作原理,并且在发布 Web 应用程序运行后出现问题,然后出现错误:“当前无法处理此请求HTTP 错误 500”。 采取的措施:
-
我在 Kudu 控制台错误描述中运行 .dll:“未处理的异常:System.IO.FileNotFoundException:无法加载文件或程序集‘System.Runtime,版本=4.2.2.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a’或其依赖项之一。系统找不到指定的文件。"
-
我试图更改 web.config 但错误是一样的
(编辑后的 web.config):
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\SportsStore.dll" stdoutLogEnabled="false" stdoutLogFile="\\?\%home%\LogFiles\stdout" hostingModel="inprocess" />
</system.webServer>
</location>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
我发现了很多关于这个问题的主题,但对我来说没有帮助。有什么建议吗?
【问题讨论】:
-
您使用什么流程发布?
-
我已经通过 VS 发布了一个应用程序 -> 发布 -> 应用程序服务 -> 根据 Adam Freeman 的书“Asp.net core mvc 2”创建新的(配置文件)。但我不确定我是否正确理解了你的问题,因为我是 Azure 的新手。
-
你的程序在本地能正常运行吗?建议尝试使用
git进行部署。
标签: c# .net-core web-config azure-web-app-service kudu