Share via


changes to C++ code doesn't compile, runs old code

Question

Monday, October 5, 2015 10:51 PM

Visual Studio 2013 - windows 8.1 (although this error existed with Visual studio 2012 and windows 7)

I have working C++ code.  I make a small change and hit the "local Windows Debugger" button and the old code runs.  There isn't a compiler error.  the change could be as simple as changing a loop size from 10 to 300.  I always have to run clean solution before it will build with the new code.  My other option is to actually put in a compiler error, compile, fix error and then it runs the new code.

The only settings in tools options that look like they might make a difference are in Debugging/general/Require Source files to exactly match the original version (checked)

Projects and Solutions/ build and run/on run, when projects are out of date: Always build.

All replies (5)

Friday, October 9, 2015 7:21 AM âś…Answered

Hi Victoria Eisele,

Please open the solution folder and check the Date Modified of the exe or dll. Then modify the code in Visual Studio, run this solution. Then check the Date Modified of exe or dll in the solution folder. Whether the Date Modified changed after modifying code? If not changed, please try run Visual Studio with Administrator.

In addition, after modifying code please build the solution (not rebuild) with right-click the solution -> Build. Please watch the Output window, whether there has some message is similar with out of date.

If possible, could you please provide a sample project or some code snippet to help us reproduce your problem? Please upload the sample project to OneDrive and share the link here.

Best Regards,
Weiwei


Monday, October 5, 2015 10:41 PM

Visual Studio 2013 - windows 8.1 (although this error existed with Visual studio 2012 and windows 7)

I have working C++ code.  I make a small change and hit the "local Windows Debugger" button and the old code runs.  There isn't a compiler error.  the change could be as simple as changing a loop size from 10 to 300.  I always have to run clean solution before it will build with the new code.  My other option is to actually put in a compiler error, compile, fix error and then it runs the new code.

The only settings in tools options that look like they might make a difference are in Debugging/general/Require Source files to exactly match the original version (checked)

Projects and Solutions/ build and run/on run, when projects are out of date: Always build.


Wednesday, October 7, 2015 2:22 AM

Hi Victoria Eisele,

Do you have this problem when you install Visual Studio or after you using for a long time?
Please create a new project to check whether it has the same problem. In my opinion, this problem often occurred when you developing a program for a long time. It is caused by the cache in Visual Studio. Please clear the .suo file in solution folder. In addition, please clear the cache under following paths.
C:\Users\v-weiwca\AppData\Local\Temp
C:\Users\username\AppData\Local\Microsoft\WebsiteCache
C:\Users\username\AppData\Local\Microsoft\VisualStudio\12.0\ComponentModelCache
C:\Users\username\AppData\Local\Microsoft\VisualStudio\12.0\ManifestCache

If it doesn't work, please check the Build column in Configuration Manager window(Build -> Configuration Manager) as below image.

Best Regards,
Weiwei


Thursday, October 8, 2015 8:57 PM

It didn't solve the problem.

I didn't have the folder

C:\Users\username\AppData\Local\Microsoft\VisualStudio\12.0\ComponentModelCache

but everything else is cleared and I tried all other suggestions.

I have created new projects and it is a problem immediately.


Wednesday, October 14, 2015 5:02 AM

Hi Victoria Eisele,

Do you have tried above steps and the problem still existing? If has been resolved, please mark the reply which helpful or share your solution here, which is better for other communities who has the same problem. If not been resolved, please provide the information that I want, I will continue following this problem.

Best Regards,
Weiwei