Missing Goal MSBuild

Is there a way to use MSBuild syntax to skip a specific target? I have a file consisting of many properties (lines containing / property: X = Y) that I want to pass to the recursively named instance of MSBuild, but this file also contains the line / target: X, which I do not want to have any the effect. I have no way to modify the file.

+4
source share
1 answer

I assume you can edit the .proj file. You can manage MSBuild targets with Condition . Your goal you want to exclude may contain the following:

 <Target Name="SomeTarget" Condition="'$(SomeProperty)'=='true'" DependsOnTargets="SomeAnotherTarget"/> 

SomeProperty can be passed in a call:

 MSBuild.exe build.proj /p:SomeProperty=false 

Hi

+8
source

Source: https://habr.com/ru/post/1315185/


All Articles