I am using MSBuild
to run some management scripts, so no compiler or linker is involved here and I noticed that the build system skips target which ran successfully in a target.
How do I force to run a target every time?
Sample:
<Project ToolsVersion="4.0" DefaultTargets="Foo" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="Foo" >
<CallTarget Targets="Bar" />
<CallTarget Targets="Bar" />
</Target>
<Target Name="Bar" >
<Message Text="Bar" />
</Target>
</Project>
Calling
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe msbuild.xml /v:d
Results in
Bar:
Bar
so it is not called twice, /v:d says that second call was skipped, but it is not clear how to avoid this without creating Targets Bar1
and Bar2
Is there a way to execute target Bar
two times in Foo
?
Searching for that revolved around cl.exe, xcopy etc detecting no changes but this is MSBuild
only