4
votes

I created an ASP.NET MVC 6 beta 8 application and when I click debug in Visual Studio 2015 I can see IIS Express and the site works properly.

But if I try and launch IIS Express from the command line pointing to the right applicationHost.config file I get and error, does something else need to be added?

C:\Program Files (x86)\IIS Express>iisexpress /config:D:\Programming\Projects\WebApplication1.vs\config\applicationHost.config /siteid:3

HTTP Error 502.3 - Bad Gateway

There was a connection error while trying to route the request.

Most likely causes: •The CGI application did not return a valid set of HTTP errors. •A server acting as a proxy or gateway was unable to process the request due to an error in a parent gateway.

Things you can try: •Use DebugDiag to troubleshoot the CGI application. •Determine if a proxy or gateway is responsible for this error.

Detailed Error Information:

Module httpPlatformHandler

Notification ExecuteRequestHandler

Handler httpPlatformHandler

Error Code 0x80070002

1
Not sure if this needs to be installed for iisexpress, but it is needed by full IIS, iis.net/downloads/microsoft/httpplatformhandlerDespertar
Thanks Despertar I have installed this for IISDotnetShadow
Unfortunately, I'm still getting the same error you are when trying to run it through full IIS. The only way I've got it to work outside visual studio is publishing the web application, then running C:\inetpub\wwwroot\project_name\approot\web.cmd which uses the new Kestrel web server. It sounds like they want to have the Kestrel web server do all the hosting and if IIS is used it will treat it more like CGI and have it generate the HTTP response which it returns. Other alternatives would be doing an nginx proxy pass (I'm sure IIS has a way to do this as well).Despertar

1 Answers

7
votes

I would:

  • hit Debug in VS
  • go to the Task manager -> Details
  • right click header row -> Select columns
  • select "Command line"
  • observe

In my case the command line is:

C:\Program Files (x86)\IIS Express\iisexpress.exe" /config:"C:\Users\username\Documents\Visual Studio 2015\Projects\myproject.vs\config\applicationhost.config" /site:"myproject" /apppool:"Clr4IntegratedAppPool