If Statement in Visual Studio Project

I have this in my Visual Studio project

<Target Name="BeforeBuild"> <Message Text="Compiling TypeScript files" /> <Message Text="Executing tsc$(TypeScriptSourceMap) @(TypeScriptCompile ->'&quot;%(fullpath)&quot;', ' ')" /> <Exec Command="tsc$(TypeScriptSourceMap) @(TypeScriptCompile ->'&quot;%(fullpath)&quot;', ' ')" IgnoreExitCode="true" /> </Target> 

I want to execute the material in <Target Name="BeforeBuild"></Target> if the Configuration Debug and Platform are AnyCPU. Is this possible, and if so, how is this done?

+4
source share
1 answer

Try to execute

 <Target Name="BeforeBuild" Condition="'$(Configuration)' == 'Debug' And '$(Platform)' == 'AnyCPU'"> 

A bit more fancy version

 <Target Name="BeforeBuild" Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'"> 
+5
source

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


All Articles