Monday, November 28, 2011

Visual Studio cannot start debugging because the debug target is missing

Sometimes you lose a lot of time finding the most idiot problems. Last week I had to do a code review so I downloaded the solution from Team Foundation Service and opened it. First I wanted to try to run the application but it failed with the following error message:


“Visual Studio cannot start debugging because the debug target 'D:\dev\ApplicationToReview\bin\Debug\ApplicationToReview.exe' is missing. Please build the project and retry, or set the OutputPath and AssemblyName properties appropriately to point at the correct location for the target assembly.”

Ok. So I rebuild the project a few times, had a look at the output folders only to see that the required assembly was definitely there. In the end I noticed that although the current project was set as the start up project but it was not configured to run in the Configuration Manager.

After checking the project under configuration manager everything worked fine.

8 comments:

Anonymous said...

You just saved me whole lot of work! Thanks!

Anonymous said...

Why is this an "idiot" mistake. Don't be so hard on youself. Everyone has something they don't know and usually problems like this are not straight forward fixes at first, you have to debug or search and find out yea it's something simple only after you come to know whatever it is you fixed it. It's not like you should know everything..that would be ridiculous then to say this is an idiot problem.

I don't get why devs feel they need to say they're asking a "stupid question" or found a "simple solution" and that they're stupid because of it. That's stupid to even have to worry about saying this in our profession if other devs are viewing each other like this.

Anonymous said...

Saved me lot of work. Thanks!

Mohan Pathare said...

Worked Perfectly.

Thank you very much.
Mohan Pathare

Anonymous said...

Thank you very much.
I was desperate. :)

Anonymous said...

Help me i don't get it

Anonymous said...

I have been having this same issue with my VS 2012 at home and found this on another thread.

"You have the option on what to do when projects are out of date set to "Never build." Go again to Tools->Options, expand the Projects/Solutions node in the tree on the left hand side, and click on "Build and Run" under Projects/Solutions. You should see a dropdown labelled "On Run, when projects are out of date:" Make sure that is set to either "Always build" or "Prompt to build".

Tom Wesson said...

Thanks for the help.

I encountered this when downloading a solution from GitHub.

They had all of the projects in the solution set to build except the Example project.