A
A
Anton Ivanov2018-06-26 13:07:28
C++ / C#
Anton Ivanov, 2018-06-26 13:07:28

Why does Visual Studio keep the old values ​​on rebuild?

Hello.
I suddenly ran into this problem: In the constructor of my class, I initialize some variables. For example the current version variable. The problem is that after pressing F7 / F5 (when only the file that changed is rebuilt), the value of the variable remains the same. That is, I add a MessageBox and it displays the value that was before the build. If you do clean, or just rebuild solution, then everything becomes ok.
And it does not matter how I initialize the variable, in the initialization list, or simply by assignment in the function body.
An attempt to debug the constructor failed because the execution jumps through the functions in a different order than they are in the file. Well, let's write off these are not the "chips" of the rezilny build.
The Debug build does not have this problem. At least one file will be compiled, the value is new.
Where to dig?
PS The variable is defined, simply as a float version;
PPS Here is the constructor

MyClass::MyClass(LPSTR lpCmdLine) :
  version(40.5f)
{
// тут код, который не влияет, глюк остается даже с пустым телом функции...
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question