[visual-studio-2010] Error while trying to run project: Unable to start program. Cannot find the file specified

This project was working fine, then I restarted my computer to install a new GPU, and now it is producing the following error when I try to run it:

Error while trying to run project: Unable to start program:

"E:\Workspace\...\....exe"

Cannot find the file specified.

I have confirmed that the file mentioned does exist at the path specified by the error message.

I have tried to "Clean Solution" and "Rebuild Solution".

Navigating to the executable file manually and running it works. The error above is produced when I press the "Run" button in VS2010.

Does anyone know why this might be happening?

This question is related to visual-studio-2010

The answer is


in my case we solved from project debugging settings like the link


I am only posting this because I had a specific issue with the command line arguments I was passing in. Being inexperienced with the command line I was using "<" and ">" in my arguments and it was redirecting the file on me. Hope this helps someone.


I had a similar problem, but none of the solutions listed here helped. My problem was that my solution has multiple projects and the wrong one was selected as the StartUp Project, once I changed that, it worked.


I just re-ran into the same issue: Console App, Visual Studio 2013, 64 bit OS. The project's settings was set to "Any CPU", I created a new configuration for x86 and VS was happy.

  • In Your Solution Explorer, Right Click your solution (.sln), choose "Configuration Manager"
  • Active Solution Platform: If it's saying "Any CPU", click the drop down arrow and choose ""
  • In the "Type or select the new platform", enter "x86"
  • Now, make sure that the "Active solution platform" is set to x86
  • Run (F5)

I encountered this error when "" was added by mistake to my command line arguments when altering properties for "All Configurations". Removing them from RightClickProject->Properties->Configuration Properties->Debugging->Command Arguments allowed it to run in the debugger again.


For me it was the virus scanner not liking the fact I have in my exe filename multiple periods.

i.e

project.class.console.exe <- won't run

console.exe <- will run

Hope it helps.


Reset the diagnostics and the static analysis under the, for example, Properties -> FORTRAN -> diagnostics. Particular be careful the 'Level of Static Security Analysis' and set it none. Good luck!


I encountered a similar problem. And I found the solution to be totally unrelated to the error. The trick was renaming the assembly name. Solution: VS 2013 -> Project properties -> Application tab -> AssemblyName property changed to new name < 25 chars


In case of Windows applications, the error is solved changing the running project properties.

  1. Right click on current running project, select Properties
  2. Debug -> Check Enable unmanaged code debugging and press save button in menu.

This configuration is not saved to [CurrentProject].csproj (or [CurrentProject].vbproj). It is saved to: [CurrentProject].csproj.user (or [CurrentProject].vbproj.user)

If you use a code repository, usually this file is not saved undo version control.


I had similar problem while using Silverlight web project...

I got resolved issue by setting startup page (In silverlight .aspx is the startup page).

In project browser right click your startup page and set it.!

see here my screen shot


I had the same problem.
The cause for me was that the Command option in Configuration Properties | Debugging had been reset to its default value.


I've tried deleting .suo; .ncb; .sdf; rebuild etc. Nothing helped. The message was:

Unable to start program
'C:\Users\some user\Downloads\project name\.\Debug\fil_name.exe'
The system cannot find the file specified.

The problem was mismatched file name and wrong path to that file.
1. So went to Project->Properties->Linker->General-> and on the right pane in 'Output file' changed the name from 'fil_name.exe' to 'file_name.exe'
The file_name.exe was in deeper folder like -> \Debug\crv.
2. Also did Project->Properties->Configuration Properties-> and on the right pane in 'Output Directory' edited '.\Debug\' to '.\Debug\crv'


Deleting and restoring the entire solution from the repository resolved the issue for me. I didn't find this solution listed in any of the other answers, so thought it might help someone.


For me, it was... the AntiVirus! Kaspersky Endpoint security 10. It seems that the frequent compilations and the changing of the exe, caused it to block the file.


I personally have this issue in Visual 2012 with x64 applications when I check the option "Managed C++ Compatibility Mode" of Debugging->General options of Tools->Options menu. => Unchecking this option fixes the problem.


I found a related thread:

Debugging Visual Studio 2010/IE 8 - Unable to start program - Element not found.

Here the best suggested answer was:

Tools > Internet Options > Advanced Under the Browsing Section

then uncheck the

"Disable Script Debugging (Internet Explorer)

The only way that I was able to get over this (reinstall wasn't an option) was to set the project properties->web->start action->"don't open a page. wait for a request from an external application."

BTW, I think that at some point this started because of a mod that I made to machine.config. :) And no, I don't remember what it was. It does seem to be this very apocalyptic bug where once you get it never goes away.

So if you found this page from Google, you should know that you are doomed. :)


I had this issue on VS2008: I removed the .suo; .ncb; and user project file, then restarted the solution and it fixed the problem for me.


From the top menu "Build" -> "Rebuild Solution", the .exe file was somehow deleted or corrupted, the "Rebuild Solution will create a new one!


I think that VS is no longer able to resolve the path for some reason.

You can try going to the "Project Properties" dialog, select the "Debug" tab, select "Start external program" on the "Start Action" group and type the full path to the executable.