我在使用 Azure 上部署的 ASP .NET Core 应用程序时遇到问题。
Azure 返回此结果:
我的问题是:我该如何调试这个?这是为什么?/为什么会出现这种情况?这是一个 Asp .Net Core 问题吗?托管问题?
我正在使用 web.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!--
Configure your application settings in appsettings.json. Learn more at http://go.microsoft.com/fwlink/?LinkId=786380
-->
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
</handlers>
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/>
</system.webServer>
</configuration>
这是我使用 .UseIISIntegration()
和 .UseUrls("http://*:5000")
var host = new WebHostBuilder()
.UseKestrel()
.UseIISIntegration()
.UseUrls("http://*:5000")
.UseContentRoot(Directory.GetCurrentDirectory())
.UseApplicationInsights()
.UseStartup<Startup>()
.Build();
host.Run();
谢谢:)
最佳答案
这里有一些你可以尝试的事情
检查 Azure 上的日志(如果启用了日志记录)
通过在启动类中使用
app.UseDeveloperExceptionPage();
和app.UseDatabaseErrorPage();
方法启用开发人员异常页面。这将显示错误,然后您可以轻松查看错误来自何处
关于c# - Azure 上的 Asp .NET Core 遇到 502 Web 服务器在充当网关或代理服务器时收到无效响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43650954/