Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unwanted rebuilds of C++ project after a Windows update

After a Windows update, Visual Studio always rebuilds my C++ project. Diagnostic log says:

Project 'my.vcxproj' not up to date because 'C:\WINDOWS\SYSTEM32\TZRES.DLL'
was modified at 01/25/2018 07:43:09, which is newer than 'DEBUG\MY.LIB'
which was modified at 01/25/2018 05:28:05

Why does visual studio checks timestamps of system32 DLLs? Especially the ones that aren’t even linked?

Rebuild doesn’t help because windows update has set both creation, modification and last access timestamps of that DLL couple hours in the future. BTW the description of the DLL says “Time Zones resource DLL”, don’t know if that related.

like image 894
Soonts Avatar asked Jan 25 '18 04:01

Soonts


1 Answers

Update

Looking at the comment by Aleksey Katargin it appears you may be able to self-fix this issue by adding $(SystemRoot)\system32 to the VC++ excludes.

Same issue with same logs. Visual Studio Professional 15.9.0
Issue occurred after win10 update to 1803
Fixed by adding $(SystemRoot)\system32 to VC++ excludes


Original reply

Looks like we are not alone Up to date projects compiled again because of TZRE.DLL date stamp is in the future after a windows update

The poor solution is to wait till that time has passed, and the problem will magically vanish. I just had the same problem, My TZRES.DLL file is 17/07/2018 19:54, the time now is 17/07/2018 15:15. My solution build takes 10 minutes, so today is going to be a bad day at the office unless I hack the modified date of the file, but I don't know what implications that will have. Alternatively change your system clock, I can't because mine's locked down by group policy.

(For other readers) You can find out the cause of this issue by going to Tools->Options->Build and Run->MSBuild project build output verbosity->Detailed. Then compiling, then searching for the phrase will be compiled.

[myfilename] will be compiled as C:\WINDOWS\SYSTEM32\TZRES.DLL was modified at 17/07/2018 19:54:54.

like image 165
GilesDMiddleton Avatar answered Sep 21 '22 11:09

GilesDMiddleton