-
Notifications
You must be signed in to change notification settings - Fork 1k
Conditionals in ItemGroup with packagereferences are not evaluating correctly #4928
Description
I have a Layout.props file with this properties:
<PropertyGroup>
<IsWindows>false</IsWindows>
<IsMac>true</IsMac>
</PropertyGroup>Additionally my project (.csproj) references this prop file, and it has some item groups with conditionals to call some desired code.
<Import Project="Layout.props" /><ItemGroup Condition=" '$(IsWindows)' == 'true' ">
<PackageReference Include="NUnit">
<Version>3.10.1</Version>
</PackageReference>
<PackageReference Include="NUnitLite">
<Version>3.10.1</Version>
</PackageReference>
</ItemGroup>
<ItemGroup Condition=" '$(IsMac)' == 'true' ">
<PackageReference Include="Xamarin.GuiUnitNg">
<Version>3.10.1</Version>
</PackageReference>
</ItemGroup>It could be related to this:
#4927
Expected: It builds
Result: Build is failing (there is no file in the output directory), the message is talking about dupplicated types but it works correctly building from msbuild from terminal.
https://gist.github.com/netonjm/75d1d03fd14bfa382c5b6c3b6bd01873
Visual Studio Enterprise 2017 for Mac
Version 7.5.1 (build 22)
Installation UUID: ac2f5f5a-65c6-4e02-aae1-61d2ac9aabc1
Runtime:
Mono 5.10.1.47 (2017-12/8eb8f7d5e74) (64-bit)
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 4.4.1.178 (master / eeaeb7e6)
Package version: 510010047
NuGet
Version: 4.3.1.4445
.NET Core
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
2.0.5
2.0.3
2.0.0
1.1.2
1.1.1
1.0.5
1.0.4
1.0.3
SDK: /usr/local/share/dotnet/sdk/2.1.4/Sdks
SDK Versions:
2.1.4
2.0.3
2.0.0
1.0.3
1.0.1
1.0.0-preview2-003156
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.10.1/lib/mono/msbuild/15.0/bin/Sdks
Xamarin.Profiler
Version: 1.6.3
Location: /Users/jmedrano/Projects/profiler/src/XamarinProfiler.Mac/bin/Debug/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
Xamarin.Android
Version: 8.3.0.19 (Visual Studio Enterprise)
Android SDK: /Users/jmedrano/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
6.0 (API level 23)
8.1 (API level 27)
SDK Tools Version: 25.2.5
SDK Platform Tools Version: 26.0.0
SDK Build Tools Version: 25.0.3
Java SDK: /usr
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL
Xamarin Inspector
Version: 1.4.0
Hash: b3f92f9
Branch: master
Build date: Fri, 19 Jan 2018 22:00:34 GMT
Client compatibility: 1
Apple Developer Tools
Xcode 9.3.1 (14154.1)
Build 9E501
Xamarin.Mac
Version: 4.4.1.178 (Visual Studio Enterprise)
Xamarin.iOS
Version: 11.10.1.178 (Visual Studio Enterprise)
Hash: 408d3574
Branch: d15-7
Build date: 2018-05-08 18:56:30-0400
Build Information
Release ID: 705010022
Git revision: 60442dd
Build date: 2018-05-15 01:43:39+00
Xamarin addins: 4194ffe4868321e4c3477bd56aed579bda4c6fbb
Operating System
Mac OS X 10.13.4
Darwin 17.5.0 Darwin Kernel Version 17.5.0
Fri Apr 13 19:32:32 PDT 2018
root:xnu-4570.51.2~1/RELEASE_X86_64 x86_64
Enabled user installed addins
Gist Ide Information 1.1.0
AddinMaker 1.4.2
MSBuild Editor 2.0.3
NuGet Package Explorer 0.2
NuGet Package Management Extensions 0.12.6
Redth's Addins 1.0.9
Show in Github 1.0.4
VSMarketPlaceManager 1.0
