Reputation: 12854
I get this error message when I'm trying to start the application.
An error occurred attempting to determine the process id of the DNX process hosting your application
Is there a way to fix the problem?
Upvotes: 102
Views: 36036
Reputation: 826
Assuming you are running IIS Express with SSL Enabled depending on your installation you will have to put your IIS Express Development Certificate(Issued To "localhost"/ Issued By "localhost") in either [Local Computer\Personal\Certificates] or [Local Computer\Trusted Root Certification\Certificates]. One of those should work. (Using Windows 10 + VS2015). HTH
Upvotes: 2
Reputation: 79
In my case in an asp net core 1.1, .net framework 4.5.2 project, the error did not refer to dnx since that is no more. Instead it referred to the project name exe. Another version of the error referred to simply being unable to connect to iis express.
The problem was the introduction of a canonical host name rewrite rule that tries to force all connections to have a host name that begins with www. e.g. redirecting gty.org to www.gty.org to conform to our ssl cert. This is fine in production but you can't force https://localhost:44347/ to begin with www and expect iis express to be able to handle it.
<rule name="CanonicalHostNameAddwww" enabled="true" stopProcessing="true">
<match url="(.*)" ignoreCase="true" />
<conditions logicalGrouping="MatchAll">
<add input="{HTTP_HOST}" negate="true" pattern="^www\." />
</conditions>
<action type="Redirect" url="http://www.{HTTP_HOST}{HTTP_URL}" appendQueryString="false" redirectType="Permanent" />
</rule>
The solution was to comment out the rule when running in visual studio or add a condition:
<add input="{HTTP_HOST}" negate="true" pattern="^localhost" />
Upvotes: 2
Reputation: 9514
Another potential solution
For anyone playing with SSL settings, I found just changing the SSL port in the launchSettings.json
file to another nearby port solved the problem.
FYI, I couldn't find anything on the machine using the original port, nor did I get a port in use error.
Upvotes: 0
Reputation: 30267
There are just so many things that could cause this error. Here are a few that worked for me:
web.config
in your wwwroot
folder. It will get recreated correctly on compilation.SSL
and in your IIS Express
and moving your SSL Cert
to the Trusted Root Certification Authorities
folder didn't work. In the Debug
tab of the Properties
of the project you are trying to run. Try unclicking the Enable SSL
checkbox and then clicking it again to enable it and get a different port. You may have to do this a few times.Upvotes: 0
Reputation: 4338
I've just discovered one more problem that was causing this!
web.config
in project root had some dodgy IIS URL rewrite rules to enforce HTTPS. Removing those rules solved the problem.
Upvotes: 0
Reputation: 569
While following this tutorial I received a similar error.
First, I received the error: "An error occurred attempting to determine the process id of dotnet.exe..." I took the following steps.
While trying a few things to solve that error I also came across this error. "An error occurred attempting to determine the process id of the DNX process hosting your application"
Which was caused by having another instance of the application running.
I hope this answer helps someone.
Upvotes: 3
Reputation: 401
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.
Upvotes: 30
Reputation: 3169
I hit this problem due to the project config trying launch https://localhost instead of http. Right click on the webproject, under "Debug" and adjust "App URL" to be http instead of https.
Another way to get around this was switching the launcher from "IIS Express" to "Web"
Upvotes: 5
Reputation: 11
Upvotes: 1
Reputation: 486
I used RC1 and EF First Code Approach. Good idea to start investigation is to run project with option: "Start project without debbuging" (Ctrl+F5). Then I get more meaningful error for me: "The configuration section 'entityFramework' cannot be read because it is missing a section declaration." It didn't work for me because of web.config file.
Upvotes: 1
Reputation: 113
I had this trouble when I'm toggling settings and have disabled the "Enable Anonymous Authentication" in the Project > Properties > Debug. Make sure that it is enabled. Close and relaunched the project then try again. Hope this helps.
Upvotes: 1
Reputation: 4756
Check web.config file for invalid entries. For example, having "entityFramework" tag there causes this problem for me.
Upvotes: 1
Reputation: 140
For what it's worth, this is a generic error message that could serve as a red herring to any number of issues where the httpPlatformHandler can't launch the given executable (dnx in this case).
In my case I received this error as a direct result of misunderstanding the launchSettings.json file. I was trying to enable the https endpoint for my application and mistakenly duplicated the sslport in my applicationUrl. As I understand it the applicationUrl should be the http hostname/port of the application and by filling in the sslPort it just configures the IIS Express environment to listen for https on the hostname given in the applicationUrl on the port provided in sslPort.
For example:
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:44000",
"sslPort": 44300
}
}
Provides the following two endpoints on localhost.
If you were to have the same port in the applicationUrl and sslPort settings, you would receive the error associated with this thread.
This is true for me on RC1
Upvotes: 11
Reputation: 7394
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.
Upvotes: 152
Reputation: 12854
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.
Upvotes: 34
Reputation: 1474
When upgrading from beta7 -> beta8 I had this issue and the suggestions provided by Ben M and Domysee worked for me. However, one of my colleagues was still having problems running our project which targets dnxcore50
only. If you make sure you have run the following commands:
dnvm install 1.0.0-beta8 -r coreclr
dnvm install 1.0.0-beta8 -r coreclr -arch x86
It was the second command in particular that fixed it on his machine. You can also double-check this folder has a dnx.exe
in it:
%userprofile%\.dnx\runtimes\dnx-coreclr-win-x86.1.0.0-beta8\bin
Upvotes: 0
Reputation: 81
It is possible to upgrade, i found i had to look through the new updated templates here.
Update your web.config in wwwroot to include:
<httpPlatform processPath="%DNX_PATH%" arguments="%DNX_ARGS%" stdoutLogEnabled="false" startupTimeLimit="3600"/>
You will also need to change the way the project debugs using Kestrel by modifying your project.json:
"commands": {
"web": "Microsoft.AspNet.Server.Kestrel"
},
"dependencies": {
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-beta8",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-beta8",
}
and modifying your hosting.ini
server=Microsoft.AspNet.Server.Kestrel
and adding this to the Configure method in startup.cs
// Add the platform handler to the request pipeline.
app.UseIISPlatformHandler();
adding these references should allow you to run the project.
Upvotes: 6