How can I detect if dependencies have changed prior to a build event in VS2010?
I have a pre-build event in VS2010 which obfuscates some开发者_JAVA百科 code. However, it runs every time I try to build the executable regardless of whether the dependencies have chanced. How can I detect if it really needs to be run?
I would look for solutions involving msbuild. Try editing the csproj file and tweak the commented out section dealing with <Target Name="BeforeBuild"> section.
From http://msdn.microsoft.com/en-us/library/ms171462(v=vs.90).aspx
Dependency Analysis
In more advanced scenarios targets can describe relationships between each other and perform dependency analysis, which allows whole sections of the build process to be skipped if that target is up-to-date. You can declare the targets that must run before a specific target by using the DependsOnTargets attribute. When a target is run, the MSBuild engine will automatically run any targets listed in this attribute first. For more information, see How to: Build Incrementally.
How to: Build Incrementally
精彩评论