Bug 22715 - 5.3 cannot parse Conditions with Or/And and $(Configuration)|$(Platform)
Summary: 5.3 cannot parse Conditions with Or/And and $(Configuration)|$(Platform)
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Visual Studio Compatibility ()
Version: 5.3
Hardware: PC Mac OS
: --- normal
Target Milestone: master
Assignee: Bugzilla
Depends on:
Reported: 2014-09-06 03:20 UTC by Tom Philpot
Modified: 2015-02-10 03:59 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

Test console project that illustrates the bug. (2.17 KB, application/zip)
2014-09-06 03:20 UTC, Tom Philpot

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Tom Philpot 2014-09-06 03:20:03 UTC
Created attachment 7955 [details]
Test console project that illustrates the bug.

The following line does not parse correctly in XS 5.3 causing the file to be marked as invalid in XS.

  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' Or '$(Configuration)|$(Platform)' == 'Debug|x64' ">

See Test1.csproj file included in Test1.zip for a standard console app whose Condition was modified to include an extra 'Or'.

I think the bug stems from this commit: https://github.com/mono/monodevelop/commit/a4d8bd1db31139f4b5eb1c0c90aa1041b6407247.

Note this works fine in 5.2.1, but fails to parse in 5.3.0 and 5.4.0
Comment 1 Lluis Sanchez 2014-09-08 05:00:42 UTC
For a property group to be considered a valid configuration by Xamarin Studio it can only have one single condition. It worked by luck in previous releases. To fix it, you can add an empty configuration group like this:

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' />
Comment 2 Tom Philpot 2014-09-08 12:42:46 UTC
Visual Studio will load the .csproj file with multiple conditions and msbuild will build the project.

Perhaps this is not a regression, but a VS msbuild compatibility issue.
Comment 3 Prashant manu 2015-02-10 03:59:17 UTC
As per comment 1 closing this issue