2017-04-27 979 views
1

我在部署在Azure上的asp.net核心应用程序出现问题。Azure上的Asp .NET Core获得502 Web服务器在充当网关或代理服务器时收到无效响应

天青返回此结果:

Result from Azure

我的问题是:我如何调试呢?这是为什么?/为什么会发生?这是一个Asp .Net核心问题?托管问题?

我使用的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> 

,这是用我的Program.cs .UseIISIntegration().UseUrls("http://*:5000")

var host = new WebHostBuilder() 
       .UseKestrel() 
       .UseIISIntegration() 
       .UseUrls("http://*:5000") 
       .UseContentRoot(Directory.GetCurrentDirectory()) 
       .UseApplicationInsights() 
       .UseStartup<Startup>() 
       .Build(); 

host.Run(); 

谢谢:)

+0

检查相关的问题[在IIS上部署asp.net核心应用达到500内部服务器错误](http://stackoverflow.com未来/一个/2833802分之39786318)。您可以从启用“stdouLog”开始 – Set

+0

您发现了吗?我也有同样的问题。 – snekkke

+0

首先,尝试输入azure(kudu)并删除wwwroot文件夹,或者确保在使用VS Studio进行部署时首先清理文件夹(删除文件),我的问题是我更改了框架并且未清理旧的发布文件 –

回答

1

这里有几件事情,你可以尝试

  1. 检查你的日志在Azure上(如果启用了日志记录)

  2. 通过在启动类app.UseDeveloperExceptionPage(); &的app.UseDatabaseErrorPage();方法使开发人员异常页面。这将显示错误,然后你可以很容易地看到那里的错误是从

相关问题