4

This issue started to happen after I upgraded to VS2017 (15.7.3)

Even for the very simple / default project, I cannot debug/run from the menu. I get the error:

The system cannot find the file specified

Note: I am 100% the project is compiled successfully. there is already an exe file (which works if I run it directly)

enter image description here

16
  • Where are the projects stored? Maybe its a permissions related issue? Can you create a solution in an older version of Visual Studio, reference the project and verify if it works or fails. Commented Jun 14, 2018 at 20:54
  • i created a new default project in c:/temp it is an open folder Commented Jun 14, 2018 at 21:00
  • Can you load it into a solution from another version of Visual Studio and run it from that environment? Commented Jun 14, 2018 at 21:01
  • Well here are some suggestions run VS as admin, try another version of VS, clean and build the solution and check settings under Tools->Options->Debugging Commented Jun 14, 2018 at 21:10
  • thanks for your ideas I tried loading projects from older version. they don't work I tried to open VS as admin. same issue What to check under Tools-Options-Debugging? Commented Jun 14, 2018 at 21:20

3 Answers 3

7

TL;DR No exact cause was determined for this specific issue. The nuclear option of reinstalling Visual Studio remedied this issue. Below are some possible solutions to try with no guarantee any will work.

Most issues similar to this one that I've experienced a reinstall would remedy the issue.


Permissions

  1. Run Visual Studio as administrator.
  2. Verify that the Visual Studio process is running as the appropriate user by using Task Manager.
  3. Verify that you're logged into the correct user within Visual Studio itself. Can try logging in and out.

Visual Studio Specific

  1. Close and re-open Visual Studio.
  2. Determine if the issue is specific to all installed versions of Visual Studio or just the current Visual Studio version. Attempt to debug the project from multiple versions of Visual Studio. This will not solve the issue, but may help to narrow the overall scope of the issue.
  3. If debugging options in "Tools->Options->Debugging" have been modified check over the settings.
  4. Sometimes Visual Studio itself can get into a funky state so attempt to clear its various caches. Here is an example of how to clear the component cache. Github - Clear Visual Studio Component Cache
  5. Attempt a repair on the Visual Studio install by going to the Control Panel's Program and Features view right click the Visual Studio install and select "Change" in the context menu. The Visual Studio installer will open. Use the "Repair" utility. Alternatively, if the thought is it is a specific installed component failing attempt to reinstall the specific component using the "Modify" option.
  6. At this point it may just be best to uninstall Visual Studio completely and reinstall it.

Project Specific

  1. Instead of performing a rebuild, perform a clean then a build.
  2. Additionally, if the step above does not give positive results use File Explorer to review what files persist after a clean operation. It may be that the clean operation didn't clean out all files. Such as those manually copied into the bin.
  3. Attempt to run the project without using the debugger. This can be done from within Visual Studio or File Explorer. In Visual Studio (2010/2012/2013/2015/2017) the default hot key is currently "Ctrl + F5". Otherwise, in the toolbar at the top of VS use the select "Debug -> Start Without Debugging". Through File Explorer navigate to the projects bin directory run the process from there by double clicking. If it runs properly from any of these scenarios and not with the debugger attached it is something to do with the debugger. It may at this point just be easiest to reinstall VS.
  4. If (and only if) you're familiar with the project (.csproj) and solution (.sln) layouts review them with a text editor. Make any necessary modifications.

Other

  1. Verify path length does not exceed Windows max path length of 260 characters. MSDN - Naming Files, Paths, and Namespaces
  2. Check Windows Event Logs.
  3. Use the command line utilities that come with Visual Studio and their varying switch options to attempt to diagnose the issue. MSDN - /Log (devenv.exe)
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for organizing everything. All the above ideas did not help , only re-install worked.
0

I was getting this same error and what was causing it was I had set up some post build events to clean out unnecessary directories for foreign languages from my bin folder. But when VS Studio couldn't find those directories, it would show these warning messages (Can't find missing files), so I removed my post build event because it was no longer needed and that fixed the issue.

So basically I would check the Pre or Post Build Events for the project before going nuclear reinstalling everything:

enter image description here

Comments

0

I have faced the same problem in visual studio with dot net project. Then I change the file location and it works for me. so I suggest you to change the file location and reopen visual studio

1 Comment

I think its an answer because in my case it works fine.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.