Question

Is it possible to ignore a target in a proj file? Anything of the sort of

msbuild amazingproject.proj /IgnoreTarget:TimeConsumingTarget

or can we set a condition value for the target while calling msbuild?

msbuild amazingproject.proj /Variable:TimeConsumingCondition=False

& in the proj file we can have

<targed name="TimeConsumingTarget" Condition="$(Variable:TimeConsumingCondition)"=="True">

Any other suggestion that works?

The whole story: We have many developers, some of whom need this target to run and some don't. So we need a conditional call for the target.

Was it helpful?

Solution

Just look at the documentation of Target.

Project:

<Target Name="TimeConsumingTarget"
        Condition="'$(BuildTimeConsumingTarget)'=='True'">

Invoked like:

msbuild amazingproject.proj /p:BuildTimeConsumingTarget=false
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top