Reputation: 148
I have some commands in post build events that i cannot move to targets and i need the post build events to run after custom target that i created. I have custom target CustomTarget
that depends on default target Build
.
<Target Name="CustomTarget" DependsOnTargets="Build">
<!--Execute some commands-->
</Target>
i've changed default target in .csproj from Build
to CustomBuild
<Project ToolsVersion="4.0" DefaultTargets="CustomTarget" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--...-->
</Project>
And code from post build events is still executed before CustomTarged
. Is there some way to execute post build events after all targets defined in DefaultTargets=""
project section?
Upvotes: 3
Views: 1663
Reputation: 28216
Try using script like:
<Target Name="CustomTarget" BeforeTargets="PostBuildEvent">
<!--Execute some commands-->
<Message Text="This is custom target"/>
</Target>
According to the log: The vs will execute custom target before post-build-event.
Upvotes: 7