Unable to start process dotnet.exe

2019-01-18 08:29发布

问题:

I am attempting to setup a new work space and transfer all of my projects from my old computer to the new one. However, I am getting this error when I try to run IIS Express:

Unable to start process C:\Program Files\dotnet\dotnet.exe. The web server request failed with status code 500.

I am working in Visual Studio 2015, update 3 and I am using .NET Core RC2. Does anyone have any idea how to fix this and get my old projects running on this new machine?

回答1:

I was having the same problem. I look for dotnet.exe in that directory and it exists but debugger cannot execute it, so i Restart Visual Studio 2015 as administrator and it works!



回答2:

Just close VS delete the project.lock.json file, open VS the file will be restored and you shouldn't have problems anymore.



回答3:

in my case. i choose "ProjectName" instead of "IIS Express" while running/debugging. and it works/open with a console output window and selected browser, keep console output window open while debugging. Hope this will work.



回答4:

The issue in my case was

1- I upgrade (ported) my project (console/website) from .net 4.5 framework to donetcoreapp 2.0

2- .NET Framework 4.5 project had Web.Config

3- dotnetcore 2.0 does not have concept of maintaining web.config.

4- So whenever I ran the project I got the same error

solution:

Just deleted 'Web.Config' and it started working for me.



回答5:

  1. Close VS 2015 (it seems that the issue is resolved in VS 2017).
  2. Remove all files in \bin and \obj. Remove project.lock.json.
  3. Run VS.
  4. Rebuild.

If the above solution doesnt work in VS2017 .Net Core, Run as VS2017 as ADMIN. If no ADMIN access to your machine, you can change the 'launchSettings.json' to work on port 8080 like below and after that follow above 4 steps.

"applicationUrl": "http://localhost:8080/",



回答6:

This is what worked for me:

I've had the same issue, and it turned out that I simply didn't have the right version of the runtime (1.1.0); instead I was trying to use 1.1.0 assemblies with 1.0.1 runtime.

The resolution is simple - download and install SDK from here, but pick the right version! It turned out that if you want version 1.1.0 you should select "Current" option (button).

Basically the problem is caused by stupid interface at the referenced page - if you don't pay attention you'll download v1.0.1 since it is "LTS" version, and "LTS" option is default there. What to say... Yet another disappointment from .NET team in this crazy-versioning, crazy-moniker, crazy-platform times...

The quotes are from peske: https://github.com/aspnet/Home/issues/1719



回答7:

this is an answer to an issue slightly different to what OP has posted. If the error message has just "dotnet.exe", not the full path of dotnet.exe("C:\ProgramFiles\DotNet\dotnet.exe"), then check if the dotnet.exe is in System.Environment path, if not add it and run VS as an admin



回答8:

Solution for me was to close visual studio 2017, and reopen the solution. :)



回答9:

I have this issue right after updating Microsoft Visual Studio 2017 pro, so far I found 3 potential solutions :

  • Restart Visual Studio works, sometimes,

  • Delete %USERPROFILE%.nuget may solve the issue,

  • Uninstall, then reinstall dotnet SDK,



回答10:

Solution for me (without administrator rights) was to:

  • Close all instances of visual studio 2017
  • Open project
  • Clean
  • Rebuild
  • Run


回答11:

In your startup project be sure that you have selected the option Enable Anonymous Authentication



回答12:

The solution in my case was deleted web.config from the root of the project. I was working on an ASPnetcore project and after a week the error started. I am unsure how that web.config file got added but once I delete that their error got resolved.



回答13:

VS2017 and solution has .NET Core 1.1 web applications.

This did not help: Deleting .VS folder, removing all bin directories, restarting VS.

This helped: Installed latest SDK (.NET Core SDK 1.0.4) this issue got resolved.

I got this issue all of a sudden after a machine reboot followed by installing PHP for IIS, IIS URL Rewrite. But just try reinstalling the SDK – it might work fine with that itself, instead of going for the latest SDK.



回答14:

I found the solution by reinstalling .NET CORE SDK



回答15:

I was able to fix the error by removing $(solutionDir).vs\config\applicationhost.config. After restart VS 2017 recreated the file.
The file became invalid after I moved the solution from one location to another.

Thanks to https://elanderson.net/2016/09/unable-to-start-process-dotnet-exe/ for the idea.



回答16:

It is caused by a wrong Path in applicationhost.config file, this file you can find inside your project folder. Go to your project folder. There you will find a .vs named folder, if you can not find it then in folder open You have to Uncheck Hidden folder. Once you have found it navigate to config folder there you find applicationhost.config. Open this file in notepad and provide your project location like that:-

<virtualDirectory path="/" physicalPath="c:\users\*****\documents\visual studio 2015\Projects\<ProjectFolderName>\<Projectname>" />

Hope this will help you.



回答17:

Visual Studio 2017 -> The fix for me was to choose the Project Name instead of IISExpress when debugging/running.



回答18:

In my case I have a few projects in one solution and none of them has been set up as startup project.

So, just right-click on project (not solution!) as choose Set as StartUp Project.



回答19:

In my case there was a setting in web.config and timeout was not defined properly, TFS placeholder was there instead of actual value requestTimeout="00:06:00"

Here is what it looks like. Hope it will be helpfull

<system.webServer>
    <handlers>
      <remove name="aspNetCore"/>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
    </handlers>
    <aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" requestTimeout="00:06:00" />
    <httpRedirect enabled="false" />
  </system.webServer>


回答20:

iisreset in cmd as Administrator did the work for me.



回答21:

In my case I accidentally install dotnet for x86 platform when my VS 2017 have x64. I reinstall dotnet for platform x64 and it works fine now.



回答22:

I had this and it turns out I was in Release build. Changed to Debug build and it worked.