Skip to content

Commit

Permalink
[msbuild][mac] Fix references netstandard libs from XM/Full (#2656)
Browse files Browse the repository at this point in the history
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 facades, `netstandard.dll` would also get referenced.

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.

Partially fixes bxc #58504 .
  • Loading branch information
radical authored and chamons committed Sep 13, 2017
1 parent c7b2d78 commit d7a2768
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions msbuild/Xamarin.Mac.Tasks/Xamarin.Mac.Common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,21 @@ 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>
</PropertyGroup>

<!-- Do not resolve from the GAC in Modern or Full unless allow-unsafe-gac-resolution is passed in -->
Expand Down

0 comments on commit d7a2768

Please sign in to comment.