Reputation: 23374
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?
Upvotes: 0
Views: 197
Reputation: 5027
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.
Upvotes: 1