Reputation: 5549
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?
Upvotes: 18
Views: 114395
Reputation: 231
I had similar trouble in Visual Studio 2019. I need rebuilding old project to new framework. I change framework with 3.5 to 4.7 it very simple, but application not started. I had try change project and solution settings long time and many position it is not helped me. Solution will be simle:
Upvotes: 0
Reputation: 647
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.
Upvotes: 0
Reputation: 19
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.
Upvotes: 1
Reputation: 303
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.
Upvotes: 1
Reputation: 367
In case of Windows applications, the error is solved changing the running project properties.
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.
Upvotes: 0
Reputation: 1
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.
Upvotes: 0
Reputation: 79
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.
Upvotes: 0
Reputation: 11
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.
Upvotes: 1
Reputation: 63
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'
Upvotes: 0
Reputation: 684
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.
Upvotes: 0
Reputation: 340
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.!
Upvotes: 0
Reputation: 41
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
Upvotes: 0
Reputation: 2442
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.
Upvotes: 0
Reputation: 1
From the top menu "Build" -> "Rebuild Solution", the .exe file was somehow deleted or corrupted, the "Rebuild Solution will create a new one!
Upvotes: -1
Reputation: 1
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!
Upvotes: 0
Reputation: 129
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)
Upvotes: 1
Reputation: 77
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.
Upvotes: 1
Reputation: 141
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. :)
Upvotes: 3
Reputation: 1249
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.
Upvotes: 23
Reputation: 5549
Using the repair tool in the VS Management fixed everything.
(I.e. right click Visual Studio 2010 and select Change/Remove from the Uninstall Programs tool in the Windows Control Panel, and click Repair in the Visual Studio Management window when it loads.)
Upvotes: 3
Reputation: 14872
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.
Upvotes: 0