35

I am trying to run a simple HelloWorld C# .NET Core Console Application and I get this error. Being fairly new, I couldn't resolve it upon trying certain things mentioned in another answer. Please guide me on how to resolve it.

The error I get is:

The debug executable [PATH] specified in the [Project Name] debug profile does not exist.

Visual Studio Screenshot

codesnerd
  • 767
  • 2
  • 8
  • 23

19 Answers19

14

For me, all I needed to do was modify the Project Properties (right click the project in the Solution Explorer --> Project Properties), then under the Application tab, select an appropriate Target Framework. It was unset for me by default.

enter image description here

Stuart Dobson
  • 3,001
  • 4
  • 35
  • 37
Theo Martin
  • 141
  • 1
  • 4
11

Copy the "cli" folder and rename it to "cli_x64". This works for me.

Adrian Mole
  • 49,934
  • 160
  • 51
  • 83
Ribeiradas
  • 111
  • 1
  • 3
  • 5
    This actual worked for me. Thanks. If anyone is wondering where the cli folder is, in my case it is in User\AppData\Local\AzureFunctionsTools\Releases\3.23.5\cli. I just changed it to cli_x64. – Arman Sep 22 '21 at 11:07
6

I had this problem very recently with a fresh installation of visual studio 2022. The error occurred when I attempted to run a project with the 5.0 DotNet Framework specified instead of the default which was 6.0. I fixed the issue by modifying my installation with the installer and manually selecting DotNet 5.0 Framework to be installed because apparently it is not installed by default and only 6.0 is. The error message wasn't in the least bit helpful at telling me what I had to do. But after that everything runs without error.

dajaco81
  • 61
  • 1
  • 5
5

Solution for Azure Functions

  1. Make sure you have azure-functions-core-tools installed.
  2. Open up your project's properties, right-click project root | properties | Debug You should see this: enter image description here
  3. Set the Launch to Executable
  4. Set the Executable to the path of your azure-functions-core-tools executable - in AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\func.exe
Luke Garrigan
  • 4,571
  • 1
  • 21
  • 29
4

Solution for VS2022

Open project properties, navigate to Debug Section and change values

enter image description here

Deano
  • 103
  • 6
LeonardoX
  • 1,113
  • 14
  • 31
  • Better to use a relative path, though the UI doesn't make it obvious how to do so. Screenshot: https://i.stack.imgur.com/e0eEa.png – Jacob Stamm Jun 16 '23 at 17:26
3

Like others here, (I upvoted a couple other answers) I tried multiple things for days and days, with no luck. In my case, a simple uninstall and reinstall of VS2019 didn't solve the problem. For me, the issue started with the VS2019 16.9.3 update, when suddenly projects that built fine before reported compile errors. The bizarre errors involved not being able to find references that were clearly there. I have a large solution with about 60 projects, of which 40 were .NET Framework 4.5.2, and 20 were .NET Core, a mix of 2.x, 3.x, and a few 5.x. At first, the compile errors affected both .NET Framework apps and .NET Core apps. I was not having this problem on my home computer, nor were my coworkers having this problem.

First, I updated all the .NET Framework apps in my solution from Framework 4.5.2 to 4.7.2. This seemed to solve it for the .NET Framework apps. However, the .NET Core apps still had ridiculous build errors, "System" not found, "NUnit" not found after creating a new test project using the NUnit3 VS template.

I tried tracking down potential NuGet configuration issues; I tried shortening the Win10 PATH statement, and nothing helped. Then, after the first uninstall/reinstall of VS2019 failed to make a difference, here is what I did that led to a successful result:

After all this, all the issues that weren't working, all the "Are you missing a using directive or an assembly reference" errors were now gone! Naturally, the needed steps will vary, based on your computer, and some of the steps I did may not have been truly necessary. After several unproductive days of nothing fixing the issue, it was time to go all-in. What a relief to have Visual Studio "just work" again!

Developer63
  • 640
  • 7
  • 19
2

To solve your problem, you need to start a VS2019 as administrator and with this the project build will work normally.

enter image description here

Note: In my case the vs2019 is professional.

Roberto Caboni
  • 7,252
  • 10
  • 25
  • 39
2

I fixed it by right clicking the project, then "unload project", then right clicking again, then "reload project". Then running the project again and the error should be gone, at least for me

BitSubmit
  • 61
  • 1
  • 6
2

So.... I’m using visual studio 2019 (version 16.10.2) on a windows 10. What fixed the issue for me were:

  1. Start a new project
  2. On the menu titled “Configure your new Project” I unchecked the option that says “place solution and project in the same directory”, then click next
  3. On the menu titled “Addition information”, I selected the current target framework which was “.Net5.0(Current)”, then click create.

Bamn!!! Fixed

Divinity
  • 93
  • 2
  • 7
1

The reason you are getting this error is because you do not have an exe file in your netcoreapp folder. Try and create a new project called HelloWorld1 and if VS19 doesn't create the files, you will need to uninstall and reinstall the application.

codesnerd
  • 767
  • 2
  • 8
  • 23
ivnoh
  • 11
  • 2
1

For me, a wrong -path in the projectname.csproj.user was the problem. This drive me nuts! After deleting this file and rebuild the project, it finally worked.

Marco G
  • 102
  • 5
1

I had a duplicate .AssemblyInfo.cs file within my project (one in the bin folder and one outside). This file is auto generated so what I did was removed both files, cleaned the project, ran a restore and then a rebuild. Fixed my issue.

1

Simple answer: Install .NET Core cross-platform development from the Visual Studio Installer in the Workloads tab. Totally working and tested here :)

Alexis Michaud
  • 239
  • 2
  • 8
1

I have changed my solution name, it occurs this error. Then I changed all using packagename to correct one, then rebuild it. It works correctly.

Saige Zhang
  • 737
  • 1
  • 7
  • 18
1
  1. Check the output path of project (Project > right click Properties > Build > Output path) Output_Path
  2. Go to Build menu > Configuration Manager. Check the myMLApp has "Build" checked Build_projects
  3. Clean solution. Build solution.

source link

Romazes88
  • 29
  • 5
1

Hi i Have a seem problem you can solve this problem open propertise project -> Debug ->open debug launch profiles ui ->change working directory set current debug folder

1

Check the error list, Form1 showing the error. Using "Show potential fixes", sorted out the issue.

musthafa k
  • 11
  • 1
  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 17 '23 at 11:47
0

I tried multiple solutions for many days, but the only thing that worked for me was completely removing VS 2019 and then re-installing.

codesnerd
  • 767
  • 2
  • 8
  • 23
  • 1
    this is not a properly solution. check here https://stackoverflow.com/a/20563832/11454967 – Cătălina Sîrbu Jun 07 '21 at 07:37
  • @CătălinaSîrbu Thanks for the input. The solution I proposed was the only one that worked out for me at the time (despite trying a myriad of others suggested on Stack Overflow). – codesnerd Jun 25 '21 at 07:39
  • Check my solution, above :) not exactly same case but it's much more simpler and probably will fix your problem (remember to mark it as accepted if it does :) – LeonardoX Nov 09 '22 at 16:17
0

For me it was just that I accidentally tried to open a project created in VS 2022 with Visual Studio 2017.

Geff
  • 49
  • 2
  • 12