简体   繁体   中英

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 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM