Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IIS Express + HttpPlatformHandler crash when launching ASP.NET 5 RC1 application

After an upgrade from ASP.NET 5 beta 7 to RC1 an attempt to launch the web appplication in IIS Express from within Visual Studio ends with "An error occurred attempting to determine the process id of the DNX process hosting your application".

In Windows Event Log I can see following errors:

  • Process '1828' failed to start. Port = 31115, Error Code = '-2147024891'. (EventID 1000; this happens always)
  • Warning: Could not create stdoutLogFile \?\C:_temp_httpplatform-stdout.log_6072_2015128124832.log, ErrorCode = -2147024864. (EventID 1004; this happens only sometimes)

Log files as configured in the HttpPlatformHandler Configuration do get created but are completely empty, as well as VS Output window.

How can I diagnose the reason for the failure?

Relevant versions are:

  • Visual Studio Enterprise 2015 Update 1
  • DNX SDK version: 1.0.0-rc1-update1
  • Windows 7 Enterprise SP1 (64-bit)

Relevant sections from web.config:

<system.webServer>
  <handlers>
    <add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
  </handlers>
  <httpPlatform processPath="%DNX_PATH%" 
                arguments="%DNX_ARGS%" 
                stdoutLogEnabled="true" 
                stdoutLogFile="C:\_temp\_httpplatform-stdout.log"
                startupTimeLimit="3600" 
                forwardWindowsAuthToken="false" />
</system.webServer>

What's perhaps also interesting is that initially when I tried to run a brand new ASP.NET 5 Web Application created from template, it worked. Now it doesn't either.

UPDATE: Despite the error IIS Express starts, but returns 502.3 Bad Gateway error

like image 740
metalheart Avatar asked Dec 08 '15 13:12

metalheart


2 Answers

So, one coworker had a similar problem.

I ended up checking the .vs\config\applicationhost.config file under the project. His turned out to have a bad < sites> section. Two of the sites were binding https to "*:44300:localhost". I removed one (the one that also bound http to 80), renumbered the sites, and his IIS Express now works.

like image 103
JonTheMon Avatar answered Nov 19 '22 08:11

JonTheMon


I just solved this issue for my sites ("An error occurred attempting to determine the process id of the DNX process hosting your application") - same boat, upgrading from Beta 7 to RC1. I believe these projects were originally created in Beta 4 or 5.

It turns out there was extra garbage in my web.config from earlier versions of the ASP.Net beta, and these were mucking up the request.

I removed these:

  <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
  <remove name="OPTIONSVerbHandler" />
  <remove name="TRACEVerbHandler" />
  <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />

And the sites began running appropriately in IIS Express. If this doesn't work for you, you might try creating a new project and seeing if it works correctly - compare the web.config, startup, and project.json files to see if there are any other changes you need to make.

like image 1
J Lothian Avatar answered Nov 19 '22 10:11

J Lothian