What does visual studio use to determine that a build is up to date?
I've written a VS addin which intercepts Visual Studio's build command and uses another build system to do a build. I've got my build showing errors in the right format so that you can click on them in VS but the one step remaining for completely seamless integration is to prevent VS's "run" or "debug" commands from whining the it doesn't think the pro开发者_如何学编程ject is built (when of course it is) does anyone know how I can trick VS into thinking the project is built?
Shortly, MSBuild / Visual Studio checks what is output of defined targets in configuration of particular project. Next it compares timestamp of file(s) specified as target output with timestamps of all files specified as input for that particular target. If input is more up-to-date than output, then it requests to regenerate output (re-compile source code or re-link object files, etc.)
How I can trick VS into thinking the project is built?
Update timestamp of input files, namely source files (.cpp
, .cs
) or binary files like .obj
used as input for linker and other files that are of your interest.
Sometimes I do it manually issuing the following command using touch utility from GnuWIn32
touch myfile.obj
Visual Studio uses the date/time stamp of the source files. If the source file is more up-to-date then the compiled binary located in bin\debug
or bin\release
, Visual Studio will rebuild the solution.
Sometimes, the rebuild process can fail, the quick solution is to delete the intermediate debug files *.pdb
within the solution's bin\debug
or bin\release
folder. Then issue a build on the solution.
Hope this helps, Best regards, Tom.
精彩评论