Carlos Rodrigez
Carlos Rodrigez

Reputation: 1455

How to add more than one condition in a propertygroup?

I have a property right now that looks like this.

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">

I now want to add another Condition in there looking like this:

Condition=" '$(SolutionFileName)' == 'SolutionName.AppNameOne.sln'"

How do I add more than one condition inside this propertygroup?

Upvotes: 27

Views: 20320

Answers (1)

Carlos Rodrigez
Carlos Rodrigez

Reputation: 1455

Use "And" for multiple conditions: https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-conditions

Example: Condition="'$(Configuration)' == 'Debug' And '$(MSBuildProjectExtension)' == '.vbproj'"

Upvotes: 46

Related Questions