Must be rebuilt in VS 2010 after each modification

I work in Visual Studio 2010, and I can understand and write code well, and IntelliSense works well, but when I go to start the compiler after changing the code, the changes are not always made. this happens in C ++ Win32 console applications, C ++ Windows applications and C ++ CLR console applications. It even happened in C # XNA.

I mean, I will start coding a new program and writing code, then go to the assembly to check for errors, then run the program and it will work fine (if there were no errors). but then if I want to iterate the code to add functions that I implement (some of them should greatly change the output), and this is similar to the first build. also, if I insert breakpoints, they are not always perceived as if they were ignored (except for those that were in pristine files). although when I am going to build at this time, the compiler correctly introduces errors (it is added purposefully and randomly), and only at these points it accepts all the changes.

The only workaround I found was to go and perform a complete rebuild after each modification, but this is not necessary, as I am not adding headers or changing the compilation order. sometimes it ignores the change of one character being modified in cout.

Summary:

  • the compiler ignores changes made since the last build.
  • compiler ignores breakpoints in modified files
  • must perform a complete overhaul to have changes, and breakpoints.

Does anyone have any thoughts on this.

edit: it seems that to fix the problem, you need to change “Tools”> “Options and Solutions”> “Build and Run”> “At startup, when projects are out of date” to “Build Request”. although annoying when asked every time he is less annoying, and then you need to manually request a rebuild. further iterations need to be done to make sure that it is not just superficial.

edit2: after continuing the iteration of the current project, it seems that this change does not fix the problem, but only for the main file, and for any auxiliary files, a complete rebuild is still required to make changes even to small ones.

+6
source share
2 answers

If this happens in all projects, probably the first fix mentioned in this answer

+3
source

After execution:

Tools -> Options -> Project and solution -> Build and run -> Make sure "When starting when projects are outdated" is set to Always Build or Request Assembly, Build -> Configuration Manager -> Make sure that for all the projects you want use, for all configurations that need to be used, "Build" is checked.

unchecking "Only create run projects and Run dependencies" did the trick for me.

0
source

Source: https://habr.com/ru/post/909964/


All Articles