I would like to add a build target to the BuildDependsOn, but I want it to only affect release builds. How do I do this in MSBuild?
A:
I think you can just add
Condition="'$(Configuration)'=='Release'"
to the <Target>
.
Brian
2010-07-09 08:39:09
What if it is a predefined target that i can not edit, such as "Package"?
Peter Moberg
2010-07-09 08:48:42
Then I think I like @madgnome's answer.
Brian
2010-07-09 09:05:32
+1
A:
Add a condition when you override the BuildDependsOn
property :
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
...
<BuildDependsOn Condition="'$(Configuration)' == 'Release'">
BeforeBuild;
CoreBuild;
AfterBuild;
NewBuildTarget;
</BuildDependsOn>
madgnome
2010-07-09 08:56:56