3

A friend was working on a Visual Basic program in Visual Studio 2010 (Express) and all of a sudden, after the code is changed or the form is modified, Visual Studio refuses to update the program when we go to debug/build it. It doesn't update the "MyAppName".exe at all.

I tried following the accepted answer to this question, which suggests deleting all the content in the bin/debug/ folder, but when I try to build his program, it simply repopulates these files:

  • MyAppName.vshost.exe.config
  • MyAppName.exe.config
  • MyAppName.vshost.exe

(I made sure I had closed VS prior to deleting, so that all the files were removed.)

If you press F5 or the debug button, VS complains:

Visual Studio cannot start debugging because the debug target 'C:\PATH_TO_PROJECT\bin\debug\MyAppName.exe' is missing...

and so on.

Any help?

Community
  • 1
  • 1
Numeri
  • 1,027
  • 4
  • 14
  • 32
  • 1
    Before deleting files did you try Build->Clean Solution, and then Build->Rebuild Solution? – Chad Dienhart Apr 23 '14 at 16:54
  • Are you compiling the code in release mode? – bastos.sergio Apr 23 '14 at 16:56
  • @chaddienhart I did not try that... I did restore the deleted files, would it help to try that now? EDIT: Build->Clean Solution nor Build->Rebuild Solution are not available. I changedd his settings from basic to expert toolset, and now it builds! What's up? – Numeri Apr 23 '14 at 17:05
  • @bastos.sergio Not as far as I know... I don't really use VB very often. How would I check? – Numeri Apr 23 '14 at 17:06
  • It happens often with VS 2010, in different flavours. Please share your setup, i.e. how many projects in a solution, and how they are relevant to each other. – Victor Zakharov Apr 23 '14 at 17:09

2 Answers2

7

Here are the steps in VS2010:

Step 1: Build -> Clean Solution This will delete all the build output files

Step 2: Build -> Rebuild Solution Rebuilds everything. Note: Build solution only builds the projects that Visual Studio determines need to be built (which is why you are not seeing all files updated). Visual Studio gets this wrong sometimes.

enter image description here

You can check to see if you are build configuration via Build -> Configuration Manager.

Chad Dienhart
  • 5,024
  • 3
  • 23
  • 30
  • Thanks! This seems like it will fix it in the future too. – Numeri Apr 23 '14 at 17:29
  • When I Clean the files aren't deleted, so the following steps doesn't work. I must to Close the IDE and delete the.files manually. Very annoying. – E_Blue Nov 18 '16 at 18:14
0

In my case root of cause was bad one of the project, that was used in many other projects. I fixed it and resolve all issues.

Nikita
  • 215
  • 3
  • 13