Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running MVC 6 Beta 8 application on IIS

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.

enter image description here

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?

like image 979
Sergey Kandaurov Avatar asked Oct 21 '15 09:10

Sergey Kandaurov


People also ask

How IIS process ASP NET MVC request?

The MvcHandler object then selects the controller that will ultimately handle the request. When an ASP.NET MVC Web application runs in IIS 7.0, no file name extension is required for MVC projects. However, in IIS 6.0, the handler requires that you map the . mvc file name extension to the ASP.NET ISAPI DLL.

Is MVC 6 a core?

MVC 6 was part of ASP.NET 5, but due to some major changes in the code base, they decided to change its name from ASP.NET 5 to ASP.NET Core.

What is IIS in ASP NET MVC?

IIS seems to be an application that listens for incoming connections, parses the data sent there as HTTP requests, and maps request urls to directories based on a site an application and a virtual directory , and then does something based on the file present (or not present) on that location.

Does ASP NET require IIS?

The answer is, no you don't.


1 Answers

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.

like image 65
Sergey Kandaurov Avatar answered Sep 19 '22 15:09

Sergey Kandaurov