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

Created on 23 Dec 2015  路  18Comments  路  Source: dotnet/aspnetcore

I'm not sure where the best place is to post this, so if this isn't the correct place please point me in the right direction.

When attempting to run the Asp.net 5 starter projects from Visual Studio 2015 Community edition update 1, using Asp.Net 5 RC1 Update 1 via the F5 key, I receive the following error "An error occurred attempting to determine the process id of the DNX process hosting your application"

Turns out that the error can be triggered by a bug which occurs if the installation is being used via a windows login name that has a space in it. e.g. "Tim Smith".

I was not able to find a patch but there is a work around. Just create another user account on the machine that doesn't have a space in it (e.g. "Tim") and use visual studio under that account. In my case this solved the issue. I can now create web projects in Visual Studio 2015 Community Edition Update 1 via the Asp.Net 5 templates and can run them via F5 and Ctl+F5 from within visual studio and I no longer receive the error.

However if I switch to the original user account on the machine that has a space in it, I still receive the error when trying to run a project generated from the same template. Same code ran from two different windows user accounts producing two very different results. Unfortunately it took me 7 days of work to find the source of this error.

Does anyone know if this issue will be fixed prior to Asp.Net 5 RC2?

All 18 comments

@joeloff

I've found that my user account doesn't have a space in it, but it does have an underscore in it, which I'm maybe guessing is causing a similar issue.

I'm getting the same error on my new desktop PC with Windows 10 Pro and Visual Studio 2015 Community Edition. My user account ID has neither spaces nor underscores, but I'm getting the error repeatedly. I created four separate projects with the ASP.NET 5 Web Application template, and each of them fails with the same error. When I open any of the four projects in Visual Studio, I can see a dnx.exe process appear in the Task Manager. But for whatever reason, Visual Studio is not able to recognize the process.

This error has nothing to do with spaces in the user name. It's a generic error that happens when the Http Platform handler cannot launch the configured executable (in this case dnx). That can be for any number of reasons.

@davidfowl I didn't mean to imply that having a space in the profile name was the only thing that could trigger this error. As you mentioned it can be caused by lots of things. I was only pointing out that in RC1 Update 1 a space in the user name _will_ cause this error. This bug took me 7 days of effort to track down exactly because the error can be triggered by so many things. For the case I'm pointing out, the underlying error caused by the space in the user name is a file not found error when launching the DNX. But that error happens silently behind the scenes and what the developer sees is the "An error occurred attempting to determine the process id of the DNX process hosting your application" error. As I mentioned on my machine I have my main user account which has a space in the name that I still can't make work, but I created a second user account that has no space and it works every time. Same code, ran on the same dev box from two different accounts.

Hi, @davidfowl! I'm having the same problem and no idea on how to fix it. In my case, nothing to do with spaces in the user name, though.

Have you tried replacing the two files in C:\Program Files\Microsoft DNX\Dnvm with the latest versions from here: https://github.com/aspnet/dnvm/tree/dev/src
Also are you running with web or IISExpress when using VS 2015, should be using the former afaik

@chaddoncooper is your comment directed to @kirby900 , @rjperes or myself? @kirby900 and @rjperes are receiving the same error as the issue I was logging but the root cause of their issues are different than mine (as noted by their comments).

Make sure you have the right processPath in web.config. I changed mine to test something, several days later reopened this proj but forgot to change it back to processPath="%DNX_PATH%" and landed on this general exception when it couldn't find the runtime.

I have the same problem. It worked before, but since two days I have the issue. (I think I only updated VS 2015 to Update 1). Even when creating a new solution from the templates, I receive the same error. No idea where to look or what to do. Starting the app with the "web" configuration works. However trying to start with IIS Express gives this error.
Any suggestions?

when i get this problem, i just change the port on the applicationUrl inside launchSettings.json. not sure though why this happens.

Same problem (404 with blank page). In launchSettings.json I have configured "applicationUrl": "http://localhost:26503/", but dnx listens on http://127.0.0.1:31750. But dnx application seems to be available, in the response header I see:

Server  Kestrel
X-Powered-By    ASP.NET

On IIS Express application works fine.

@krispaks Thanks, that did the trick for me as well.

I got this error because I misunderstood how launchSettings.json worked when enabling SSL. I mistakenly believed the applicationUrl and the sslPort needed to match. i.e. I set my applicationUrl to https://localhost:43000 and then my sslPort to 44300.

I understand now that applicationUrl is probably the hostname(?) and sslPort just uses that same hostname with the ssl port tagged on.

I ran across a solution on StackOverflow.

Steps
Close VS, Delete project.lock.json, I also did a dotnet restore, reopen VS and rerun.

@TJSoftware

Thanks, I can confirm that this method solved the error for me.

I am using VS 2015 Update 2, Windows 10 and getting the same error. None of the above solutions helped to resolve it. I posted a question on StackOverFlow.

Is it a bug in VS 2015 Update 2 when running on Windows 10?

The original error I reported when I opened this issue has now been resolved by the ."NET Core SDK Installer (Preview 1)" found here: https://www.microsoft.com/net/download

I can now create and run MVC Core projects under windows login accounts that have a space in them like "Tim Smith"

A big THANK YOU for fixing the issue.

This issue can now be closed.

Was this page helpful?
0 / 5 - 0 ratings