Reputation: 3098
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?
Upvotes: 1
Views: 1127
Reputation: 49970
Add a condition when you override the BuildDependsOn
property :
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
...
<BuildDependsOn Condition="'$(Configuration)' == 'Release'">
BeforeBuild;
CoreBuild;
AfterBuild;
NewBuildTarget;
</BuildDependsOn>
Upvotes: 4
Reputation: 118855
I think you can just add
Condition="'$(Configuration)'=='Release'"
to the <Target>
.
Upvotes: 1