[c#] C# Debug - cannot start debugging because the debug target is missing

I am fairly new to C#..

I am using Visual Studio 12, the source I am using was last edited in VS 12.. But my problem is that it's throwing me this error: enter image description here

First of all, my computer username isn't Martin, it is Administratoring - The creator of this project is Martin.. So that's where I guess it's coming from, but I don't know how to fix this.

I have tried editing in Project > Properties > Build > Output Path - And it still doesn't work. I am not too familiar with C#, and I've spent some time searching up for a solution but can't find it anywhere.. Probably because I don't know what I should be searching up (I've tried searching keywords and quotes from the error, but still nothing)

This question is related to c# visual-studio

The answer is


You are not set the startup project so only this error occur. Mostly this problem occur when your working with more project in the single solution.

First right click on your project and "Set as Start Up Project" and/or right click on the start up file inside the sleeted project and click "Set StartUp File".


Application Property

Switch Target framework to 4.5.2 or something higher and bring it back to your original version (example: 4.5) then when you build, it will work.


Please try with the steps below:

  1. Right click on the Visual Studio Project - Properties - Debug - (Start Action section) - select "Start project" radio button.
  2. Right click on the Visual Studio Project - Properties - Debug - (Enable Debuggers section) - mark "Enable the Visual Studio hosting process"
  3. Save changes Ctrl + Shift + S) and run the project again.

P.S. I experienced the same problem when I was playing with the options to redirect the console input / output to text file and have selected the option Properties - Debug - (Start Action section) - Start external program. When I moved the Solution to another location on my computer the problem occurred because it was searching for an absolute path to the executable file. Restoring the Visual Studio Project default settings (see above) fixed the problem. For your reference I am using Visual Studio 2013 Professional.


For those with this kind of problem - another solution: Pay attention also to Warnings when you build solution. For example, I had referenced a dll built with higher version of .NET (4.5.2) than my main project (4.5) After I referenced a dll built with 4.0 build process was successful.


I had the same problem and unfortunately non of above answers worked for me . the solution that worked for me is :

right click on your startup project and select Properties - Debug and change "start external program: " to the correct path

Done!


I also get this error quite often.

I solve this by modifying the code (doing a very small change), saving it, then building the solution again.


In my case I had added a project to a solution manually, where that project was targeting a higher .NET version than the rest of the projects that were referencing it. Strange... there would normally be a somewhat more verbose, literal and descriptive error in such cases.

There wasn't a real error but there was a warning that said as much.


Go to Project > properties > Debug Tab and set the Launch to "Project"


Try these:

  1. Make sure that output path of project is correct (Project > Properties > Build > Output path)

  2. Go in menu to Build > Configuration Manager, and check if your main/entry project has checked Build. If not, check it.


I had the same problems. I had to change file rights. Unmark "read only" in their properties.