Unable to start process dotnet.exe

C#asp.netVisual Studio.Net Core

C# Problem Overview


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?

C# Solutions


Solution 1 - C#

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!

Solution 2 - C#

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

Solution 3 - C#

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.

Solution 4 - C#

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.

Solution 5 - C#

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

Solution 6 - C#

  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/";,

Solution 7 - C#

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

Solution 8 - C#

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

Solution 9 - C#

In your startup project be sure that you have selected the option Enable Anonymous Authentication enter image description here

Solution 10 - C#

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.

Solution 11 - C#

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,

Solution 12 - C#

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

Solution 13 - C#

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.

Solution 14 - C#

Solution for me (without administrator rights) was to:

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

Solution 15 - C#

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.

Solution 16 - C#

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.

Solution 17 - C#

I found the solution by reinstalling .NET CORE SDK

Solution 18 - C#

iisreset in cmd as Administrator did the work for me.

Solution 19 - C#

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.

Solution 20 - C#

If using IIS instead of IIS Express, just restart the service or:

  1. open IIS
  2. open your project folder from Sites tree view
  3. select site
  4. in Manage Websiteclick on Restart button

Solution 21 - C#

For whom is having problem with Visual Studio 2019 because was using the previous version of Visual Studio, jus delete the .vs folder that is in the root of the project and rerun the application, the problem must be resolved. That worked for me.

Solution 22 - C#

  1. I have removed the .vs folder from the project folder. It solved my issue.
  2. The .vs folder will be created when the project runs

Solution 23 - C#

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.

Solution 24 - C#

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>

Solution 25 - C#

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

Solution 26 - C#

In my case, I just change modules="AspNetCoreModuleV2" to modules="AspNetCoreModule" and working fine. The final web.config looks like as below.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <handlers>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
    </handlers>
    <aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" startupTimeLimit="3600" requestTimeout="23:00:00">
      <environmentVariables />
    </aspNetCore>
    <httpProtocol>
      <customHeaders>
        <remove name="X-Powered-By" />
      </customHeaders>
    </httpProtocol>
  </system.webServer>
</configuration> 

Solution 27 - C#

I had to do a repair installation of .net core 2.2 sdk to fix this issue. Using VS 2017.

Solution 28 - C#

My problem resolved by:

Goto: .vs\config\applicationhost.config file and set overrideModeDefault to Allow instead of Deny

<section name="windowsAuthentication" overrideModeDefault="Allow" />

Solution 29 - C#

looks like you don't have <appSettings> tag in your web.config. If you add that you will be able to resolve this problem.

For Example :

<appSettings>
<add key="TestKey" value="TestValue"/>

Solution 30 - C#

In my case the error returned was 503, not 500. It turned out that the application pool for the web site was using an account that had the password changed. Updating the password for the application pool identity resolved the issue.

Solution 31 - C#

I found myself running into a similar issue following an update to Docker. The update must have restored configuration settings to default as the error message stated: Access is denied.

If anyone runs into that dilemma, try doing a clean uninstall and re-install of Docker following install recommendations for your OS (ex: Windows with WSL 2 backend) and then remove the .vs folder of your project and try restarting Visual Studio and run with administrator.

After all this, if you're still running into the error, make sure you have the right SDK installed!

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionreno52491View Question on Stackoverflow
Solution 1 - C#Armando RamirezView Answer on Stackoverflow
Solution 2 - C#Alban GashiView Answer on Stackoverflow
Solution 3 - C#immirzaView Answer on Stackoverflow
Solution 4 - C#Sohel RanaView Answer on Stackoverflow
Solution 5 - C#cyberwild360View Answer on Stackoverflow
Solution 6 - C#Grigory BushuevView Answer on Stackoverflow
Solution 7 - C#ZozoView Answer on Stackoverflow
Solution 8 - C#Srivathsa Harish VenkataramanaView Answer on Stackoverflow
Solution 9 - C#Denny PuigView Answer on Stackoverflow
Solution 10 - C#Sunil Vishnu RaskarView Answer on Stackoverflow
Solution 11 - C#willllView Answer on Stackoverflow
Solution 12 - C#jbookerView Answer on Stackoverflow
Solution 13 - C#MayankGaurView Answer on Stackoverflow
Solution 14 - C#Donat SasinView Answer on Stackoverflow
Solution 15 - C#Michael FreidgeimView Answer on Stackoverflow
Solution 16 - C#se7vanjView Answer on Stackoverflow
Solution 17 - C#Hassan TariqView Answer on Stackoverflow
Solution 18 - C#gnericView Answer on Stackoverflow
Solution 19 - C#AnsverView Answer on Stackoverflow
Solution 20 - C#Sayed Abolfazl FatemiView Answer on Stackoverflow
Solution 21 - C#Diógenes FrançaView Answer on Stackoverflow
Solution 22 - C#Arul Alex RajView Answer on Stackoverflow
Solution 23 - C#1_bugView Answer on Stackoverflow
Solution 24 - C#Ali UmairView Answer on Stackoverflow
Solution 25 - C#ScottieView Answer on Stackoverflow
Solution 26 - C#Harsh GuptaView Answer on Stackoverflow
Solution 27 - C#JacNetView Answer on Stackoverflow
Solution 28 - C#MadanDView Answer on Stackoverflow
Solution 29 - C#Amit SinghView Answer on Stackoverflow
Solution 30 - C#Jordan RyderView Answer on Stackoverflow
Solution 31 - C#Chioke AarhusView Answer on Stackoverflow