问题
I'm trying to publish my MVC 6 Beta 8 app. I was able to successfully publish it to Azure, but when I try to publish it to ASPHostPortal, I'm getting 500 error.
So I tried to publish the app to a local IIS and also failed. First, I figured out that I need to install HttpPlatformHandler (otherwise IIS was not able to load web.config). But even after that, I'm getting 502.3 error.
HTTP Error 502.3 - Bad Gateway
There was a connection error while trying to route the request.
Also in Event Log I can see an error 1000 from HttpPlatformHandler with no description. But it says "Process '0' failed to start. Port = 13679, Error Code = '-2147024894'."
stdout.log is created but is empty.
Here is my web.config:
<configuration>
<system.webServer>
<handlers>
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified"/>
</handlers>
<httpPlatform processPath="..\approot\web.cmd" arguments="" stdoutLogEnabled="true" stdoutLogFile="stdout.log" startupTimeLimit="3600"></httpPlatform>
<httpErrors errorMode="Detailed" />
<asp scriptErrorSentToBrowser="true" />
</system.webServer>
<system.web>
<customErrors mode="Off" />
<compilation debug="true" />
</system.web>
</configuration>
Where do I go from here?
回答1:
Thanks to Daniel's comment and https://github.com/aspnet/Hosting/issues/364 I figured out that HttpPlatformHandler 1.0 that I installed via Web Platform Installer does not support relative paths. So I installed HttpPlatformHandler 1.2 and now it works!!
- x86 version: http://go.microsoft.com/fwlink/?LinkId=690722
- x64 version: http://go.microsoft.com/fwlink/?LinkId=690721
The alternative solution (also worked for me) was to use full paths in httpPlatform configuration instead of relative paths.
来源:https://stackoverflow.com/questions/33255222/running-mvc-6-beta-8-application-on-iis