An error occurred attempting to determine the process id of the DNX process hosting your application

For me the problem was solved by closing down Visual Studio, deleting

project.lock.json

and starting Visual Studio again.

Edit: I was using RC1.


Microsoft changed the hosting model as described in the release notes.

In project.json replace the dependency

"Microsoft.AspNet.Server.IIS": "1.0.0-beta7"

with

"Microsoft.AspNet.Server.Kestrel": "1.0.0-beta8"


In web.config in the handlers section remove every entry except

<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />

The complete web.config will look like this:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <handlers>
      <add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified"/>
    </handlers>
    <httpPlatform processPath="%DNX_PATH%" arguments="%DNX_ARGS%" stdoutLogEnabled="false" startupTimeLimit="3600"/>
  </system.webServer>
</configuration>

RC1: While using RC1 I had the error after moving the solution folder. After deleting the bin and obj folders everything worked again.
As user764754 noted, simply restarting Visual Studio can also help.


For other people having this problem, in cases in which the other solutions don't work - I found the answer in this thread: Forcing to use SSL: An error ocurred attempting to determine the process id of the DNX process hosting your application

I your project uses or enforces SSL run it without debugging (CTRL+F5) first, it will ask you to generate a local SSL cert, and after that debugging will work and the error will be gone.