IIS Express command line ASP.NET MVC 6 beta 8

2019-06-27 04:42发布

问题:

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:

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