Skip to content

Commit

Permalink
dir.props: Update mono build to target 4.6 instead of 4.5.1
Browse files Browse the repository at this point in the history
This also fixes the build for mono/osx.

The build would break because mcs was getting duplicate references like:

    1. /reference:/Users/ankit/dev/misc/lib/mono/4.5-api/Facades/System.IO.dll
    2. /reference:/Users/ankit/.nuget/packages/System.IO/4.0.10/ref/dotnet/System.IO.dll

Ref(1) was resolved because of `ImplictlyExpandDesignTimeFacades`, and
the latter came from the task `PrereleaseResolveNugetPackages`. This
task reads from the project.lock.json (generated by `dnu restore`), and
for 4.5.1 case these assemblies were marked to have the assemblies from
the package be used. This is not the case for 4.6, where these
assemblies instead have entries like `ref/net45/_._`, effectively
suggesting that the assembly should be resolved from the GAC instead.

There are newer version of these package (like System.IO) available,
which seem to fix this, but it seems to be in flux.

Instead, we just target 4.6 completely for mono builds, which is the
same as the build for Windows and CoreCLR.

This also means that you cannot use mono < 4.4.x to build, since .net
4.6 API will become available only with mono 4.4.0 . But that is OK as
we cannot really get a useful build with the older mono anyway.

This does not affect CoreCLR builds that use mono host.
  • Loading branch information
Ankit Jain committed Mar 10, 2016
1 parent e3d8879 commit eac6c52
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions dir.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
</PropertyGroup>

<PropertyGroup>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<!-- This is to workaround an issue with a dependent assembly (Microsoft.Build.Tasks.CodeAnalysis.dll)
copying its dependencies (which are in the GAC). -->
<DoNotCopyLocalIfInGac>true</DoNotCopyLocalIfInGac>
Expand Down Expand Up @@ -158,7 +157,7 @@
<PlatformTarget>$(RuntimeArchitecture)</PlatformTarget>
<ImportGetNuGetPackageVersions Condition="'$(OS)' != 'Windows_NT'">false</ImportGetNuGetPackageVersions>
<NuGetTargetMoniker Condition="'$(NetCoreBuild)' == 'true'">DNXCore,Version=v5.0</NuGetTargetMoniker>
<NuGetTargetMoniker Condition="'$(MonoBuild)' == 'true'">.NETFramework,Version=v4.5.1</NuGetTargetMoniker>
<NuGetTargetMoniker Condition="'$(MonoBuild)' == 'true'">.NETFramework,Version=v4.6</NuGetTargetMoniker>
<NuGetTargetMoniker Condition="'$(NetCoreBuild)' != 'true' and '$(MonoBuild)' != 'true'">.NETFramework,Version=v4.6</NuGetTargetMoniker>
</PropertyGroup>

Expand All @@ -179,8 +178,8 @@
</PropertyGroup>

<!-- .NET Core build support -->
<PropertyGroup Condition="'$(NetCoreBuild)' != 'true'">
<TargetFrameworkVersion Condition="'$(TargetFrameworkVersion)' == ''">v4.5.1</TargetFrameworkVersion>
<PropertyGroup Condition="'$(MonoBuild)' == 'true'">
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(NetCoreBuild)' == 'true'">
Expand Down

0 comments on commit eac6c52

Please sign in to comment.