Unable to start program dotnet.exe the system cannot find the file specified

Skip to content

I seem to start getting this message after working on a .NET Core 1.1 Web API project for several days. I do not know the *right* solution to the problem, [and if I do i’ll update this page accordingly], but for now, I have found a workaround.

[Edit 07/07/2017: I have a suspicion that my problem may have something to do with running Windows 10 inside of Parallels 12 on a Mac with Home Folders sharing turned on. This creates an interesting scenario where IISExpress configuration files get stored in the host filesystem. Every once in a while I find that accessing files in this fashion seems to fail? I will investigate as I can. Its only a flimsy hunch at this point.]

On my machine, dotnet.exe is located at C:\Program Files\dotnet\dotnet.exe. You may have to search around if your configuration is different.

You may want to try these things first, before you resort to my work-around:

  • Deleting project.lock.json
  • Deleting the .vs folder
  • Repairing the .NET Core install
  • Repairing the VS 2015 install [or 2017 as in my case]
  • Uninstalling and reinstalling .NET Core/SDK/Tooling
  • Rebooting
Microsoft Windows Visual Studio 2017 missing dotnet.exe problem

What I Do To Workaround the missing dotnet.exe problem

  1. If you’re building and running a debug version of your service on your local machine, find the file appsettings.Development.json and move it to the location where your service DLL gets built. [e.g. c:\mydevelopment\mysolution\myproject\bin\Debug\netcoreapp1.1].
  2. Rename appsettings.Development.json to appsettings.json [only in the copied location – leave the original alone].
  3. Open a command prompt. It does not need to be administrator.
  4. Change your directory to match where the service .DLL is being built [e.g. CD c:\mydevelopment\mysolution\myproject\bin\Debug\netcoreapp1.1]
  5. Manually run the dot net.exe on your .dll:
"C:\Program Files\dotnet\dotnet.exe" MyService.dll
Hosting environment: Production 
Content root path: C:\mydevelopment\mysolution\myproject\bin\Debug\netcoreapp1.1 
Now listening on: //localhost:5000 
Application started. Press Ctrl+C to shut down.

Debugging

For debugging, I had to resort to using “Attach to Process”. On the Attach to Process window, there is a check box to Show processes from all users. Using this approach, I was able to find the dot net.exe process that is running my debug build, and debugging seems to work normally after you attach to the appropriate process.

Attach to Process Window

Comments?

Please comment if you’ve found a better solution!

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?

asked Jul 20, 2016 at 18:46

marino-mcgallamarino-mcgalla

7591 gold badge5 silver badges4 bronze badges

6

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!

answered Jul 21, 2016 at 17:47

Armando RamirezArmando Ramirez

1,1011 gold badge6 silver badges5 bronze badges

8

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

answered Aug 28, 2016 at 8:28

1

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.

answered Aug 21, 2017 at 7:16

immirzaimmirza

7,2346 gold badges49 silver badges77 bronze badges

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.

answered Apr 26, 2017 at 7:42

Sohel RanaSohel Rana

1813 silver badges13 bronze badges

0

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

answered Jun 19, 2018 at 16:55

0

  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": "//localhost:8080/",

Raj

1731 silver badge6 bronze badges

answered Jun 15, 2017 at 15:51

1

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: //github.com/aspnet/Home/issues/1719

answered May 1, 2017 at 15:24

ZozoZozo

711 silver badge4 bronze badges

1

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

answered Jun 3, 2017 at 10:55

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

answered Mar 6, 2018 at 16:52

Denny PuigDenny Puig

5828 silver badges11 bronze badges

1

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.

answered Mar 19, 2018 at 5:54

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,

answered May 15, 2017 at 14:16

willllwillll

1,7111 gold badge15 silver badges23 bronze badges

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

answered Jun 13, 2017 at 18:38

Judy007Judy007

5,1763 gold badges41 silver badges63 bronze badges

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:-

Hope this will help you.

mrCarnivore

3,7072 gold badges11 silver badges29 bronze badges

answered Nov 22, 2017 at 12:26

MayankGaurMayankGaur

86711 silver badges21 bronze badges

Solution for me [without administrator rights] was to:

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

answered Sep 13, 2017 at 9:32

Donat SasinDonat Sasin

3011 gold badge4 silver badges9 bronze badges

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 //elanderson.net/2016/09/unable-to-start-process-dotnet-exe/ for the idea.

answered Sep 25, 2017 at 21:41

Michael FreidgeimMichael Freidgeim

25.1k16 gold badges143 silver badges165 bronze badges

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.

petezurich

8,5459 gold badges38 silver badges56 bronze badges

answered Jul 12, 2017 at 18:14

se7vanjse7vanj

1602 silver badges8 bronze badges

I found the solution by reinstalling .NET CORE SDK

answered Aug 15, 2017 at 10:25

iisreset in cmd as Administrator did the work for me.

answered Aug 22, 2018 at 8:42

gnericgneric

3,1171 gold badge15 silver badges28 bronze badges

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.

answered Sep 5, 2018 at 8:30

1

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

answered Apr 30, 2019 at 15:25

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.

answered Sep 18, 2019 at 11:23

1

  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

answered May 28, 2021 at 3:54

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.

answered Oct 26, 2017 at 9:53

1_bug1_bug

5,2764 gold badges49 silver badges54 bronze badges

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


    
      
      
    
    
    
  

answered May 30, 2018 at 7:21

Ali UmairAli Umair

1,3661 gold badge21 silver badges38 bronze badges

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

answered Nov 23, 2018 at 15:43

ScottieScottie

10.9k19 gold badges67 silver badges108 bronze badges

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



  
    
      
    
    
      
    
    
      
        
      
    
  
 

answered Mar 1, 2019 at 10:40

Harsh GuptaHarsh Gupta

1971 silver badge14 bronze badges

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

answered Sep 26, 2019 at 17:49

My problem resolved by:

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

answered Sep 27, 2019 at 9:46

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

For Example :



answered Oct 10, 2019 at 10:42

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.

answered Nov 14, 2019 at 15:29

Jordan RyderJordan Ryder

1,8931 gold badge20 silver badges27 bronze badges

Chủ Đề