Fix netstd2 issue on XM full by expanding facades the same as Modern (#2731)

- https://bugzilla.xamarin.com/show_bug.cgi?id=59474
- The idea is to force Full and Modern to expand facades the same way. That way, we get the same, working behavior.
- f79f2e4 was not sufficient, even though it matched XI, because of the difference between XI (and Modern) and what Full was doing.
- Some context:

PR #2685

And that was problematic because it was expanding the netstandard facades from `Microsoft.NET.Build.Extensions`
in the `ImplicitlyExpandNETStandardFacades` target.
But we want to build against XM's bundled facades *only*. So we disable the ns facades completely
by setting `$(ImplicitlyExpandNETStandardFacades) = false`.

But now we are in the situation where a XM/Full project referencing a ns project might fail to build
because of a missing `netstandard.dll` reference! And this same case was fixed for XM/Modern projects in
https://github.com/xamarin/xamarin-macios/pull/2643 . So, we enable the use of that for XM/Full projects too
through `Xamarin.Mac.msbuild.targets`.
This commit is contained in:
Chris Hamons 2017-09-21 13:40:48 -05:00 коммит произвёл GitHub
Родитель bc5b9353fe
Коммит b905719707
2 изменённых файлов: 2 добавлений и 17 удалений

Просмотреть файл

@ -87,21 +87,7 @@ Copyright (C) 2014 Xamarin. All rights reserved.
<PropertyGroup Condition="'$(TargetFrameworkName)' == 'Full'">
<AssemblySearchPaths>$(XamarinMacFrameworkRoot)/lib/reference/full;$(XamarinMacFrameworkRoot)/lib/mono;$(AssemblySearchPaths)</AssemblySearchPaths>
<!--
This is to handle the case of XM/Full project referencing a netstandard project.
For XM/Full, $(TargetFrameworkDirectory) is `lib/mono/4.5` which has `netstandard.dll`.
This causes ImplicitlyExpandNETStandardFacades to skip expanding assuming that when ImplicitlyExpandDesignTimeFacades
expands the facades, `netstandard.dll` would get referenced too.
But if the XM project does NOT have any System.Runtime facades, then ImplicitlyExpandDesignTimeFacades will not expand
the facades and so we end up with no `netstandard.dll` reference!
With `$(NETStandardInbox) == false`, `ImplicitlyExpandNETStandardFacades` behaves as if `netstandard.dll` was not
available in the framework directories and will expand the facades if required.
-->
<NETStandardInbox Condition="'$(NETStandardInbox)' == ''">false</NETStandardInbox>
<ImplicitlyExpandNETStandardFacades>False</ImplicitlyExpandNETStandardFacades>
</PropertyGroup>
<!-- Do not resolve from the GAC in Modern or Full unless allow-unsafe-gac-resolution is passed in -->

Просмотреть файл

@ -29,6 +29,5 @@ Copyright (c) 2017 Microsoft Corp. (www.microsoft.com)
</ItemGroup>
</Target>
<!-- Modern/Mobile does not get ImplicitlyExpandDesignTimeFacades as Microsoft.NETFramework.CurrentVersion.targets isn't pulled in -->
<Import Project="$(MSBuildThisFileDirectory)Xamarin.Mac.Common.ImplicitFacade.msbuild.targets" Condition="'$(TargetFrameworkName)' == 'Modern'"/>
<Import Project="$(MSBuildThisFileDirectory)Xamarin.Mac.Common.ImplicitFacade.msbuild.targets" Condition="'$(TargetFrameworkName)' == 'Modern' Or '$(TargetFrameworkName)' == 'Full'"/>
</Project>