Visual Studio recompiles one file each time

Is there a way to recompile one file each time the project is compiled? I have about 200 cpp files in the project and I have minimal rebuilding - vs recompiles only the changed files, but one file needs to be recompiled every time I compile the project, because it contains a timestamp and a few things that depend on compilation time, is there any way to mark any file with the "recompile force" flag? I know that I can add space and delete it in this file every time I compile a project, but I need to do this automatically.

+6
source share
1 answer

You can add a custom pre-build event for the project. In this step, do something to change the timestamp of the file you are interested in (for example, copy the contents of the file to the same file)

enter image description here

+9
source

All Articles