Unable to start debugging. Unable to start program...The system cannot find the file specified


  • Hello,
    When I try to debug my C++ program in .NET, I press F5 (or click the debug arrow from the main menu) I get the above error. The directory in the above message is wrong, it points to a an old project that no longer exists. I checked the Command value in the project properties and its correct (by right clicking the project in the solution explorer). If I right click the project and hit debug from the pop-up menu, it does execute the right program, just not from the main menu. Can anyone help, I have tried changing properties of everything, installed framework 2.0, searched the registry for references to the old project, deleting the pdb and debug directory and done a full rebuild, but no joy. Any help would be greatly appreciated.
    Thursday, November 30, 2006 2:22 PM


  • Can you try right clicking on the project in question and selecting "set as startup project". 


    Thursday, November 30, 2006 5:33 PM

All replies

  • Can you try right clicking on the project in question and selecting "set as startup project". 


    Thursday, November 30, 2006 5:33 PM
  • Hi John,
    That fixed it. Thank you. Much appreciated.
    Friday, December 01, 2006 8:55 AM
  • Hello there. Well i have the same problem as dumbmonkey and selecting wjhat you tols hom to select does not help me out.  My error says:


    Unable to start program...........


    The system cannot find the file specified. Same deal. I right clicked on Project and selected "set as startup project" and nothing happened. Even when compiled once agian. Thanks!

    Monday, February 12, 2007 6:41 PM
  • Woah! So glad I found this!
    Thank you for the solution!
    Thursday, February 21, 2008 10:02 PM

    Hey Wayouk,

         Well, I tried to do the same as dumbmonkey and I got the same thing that you did.  I didn't realize that I forgot something basic.  I forgot the using namespace std;

         You should double check the beginning too.  However, I do have the same problem still with most of my programs, even ones that have run before perfectly sound.  So, hopefully this helps.  Hey, maybe you can help me out with this too.

    Thursday, April 03, 2008 12:20 AM
  • what do u rite clik on???????
    Friday, October 03, 2008 4:49 PM
  • It's not working for me. It warns me that test - Debug Win32 is outdated even if I click "set as startup project". Then it says I have errors, even though the syntax is fine and nothing is highlighted. Then it gives me the error the original poster had.
    Is there anything more specific I have to do?
    Sunday, June 14, 2009 7:12 AM
  • It worked when I right clicked on the project name in solution explorer on (REBUILD) and set as startup project.  Not sure if that was the right thing to do but hey its day 2 and it works for now;)
    Wednesday, October 07, 2009 8:51 PM
  • Each time I try to run my program after building, it wouldn't run after clicking the start without debugging.It will show the message " the system cannot find the file specified. What do I do?

    Thursday, October 08, 2009 7:58 PM
  • I've encountered the same problem when I entered a wrong executable name. Here is how I solved the problem;  I was trying to debug a sollution with 7 projects on it.  Each time I try to compile it was asking for a name for the executable. If you give the absolute path of your project (...\Visual Studio 2008\Projects\yourProjectName\Debug\yourProjectName.exe ) it works fine! 

    hope that helps 

    Wednesday, August 04, 2010 9:46 AM
  • I dont know if anyone still has that problem but to whoever might encounter that problem what I did was I right clicked on the project's name and I clicked on "Build" and then after that just Ctrl+ f5 and it works
    Thursday, January 20, 2011 4:46 AM
  • It works for me tks.

    Ctrl+ f5, close and f5 or click the debug arrow (if you want to run the debugger)

    Wednesday, July 06, 2011 1:49 PM
  • I was using visual studio 2010 and I opened a header file in the source file folder in the project explorer and used it to write my "main() function... I copied the code and then opened a new source file (.cpp) and restored the code to the new source file and it worked perfect... (Well not perfect, I had to correct a bunch of errors, but the debugging worked).
    Saturday, November 19, 2011 4:38 AM
  • For me, in VS 2013 the problem was, that in build was error. Try rebuild to find error :)
    Wednesday, December 11, 2013 10:43 PM
  • My solution is really behaving strangely. I have Built the solution, Set the Start Up Project as well as the Start Up Page and have checked all my form declarations and still I am getting this same error being discussed.

    Strangely enough, the app won't run when using debugging (F5) but when I use Ctrl + F5 it shows the same error but opens up the browser and displays the site.

    Could this be due to a OS update? I'm running Windows 8 and am using Visual Studio 2010.

    Let me know if there are any other things I could try to do to resolve the problem?

    Thursday, June 12, 2014 7:40 AM