From: Ankit Jain Date: Tue, 23 Feb 2016 21:03:48 +0000 (-0500) Subject: Do not remap framework assembly if it's version is higher than the runtime version X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=mono.git;a=commitdiff_plain;h=100bd760a46811121b4b47ebba941d4fb98486ab Do not remap framework assembly if it's version is higher than the runtime version Currently, assemblies like Microsoft.Build.Framework and Microsoft.Build.Engine get remapped to the current runtime version, at load time. This means that if an assembly references the above assemblies with a version like `14.1.0.0`, then that would get remapped to `4.0.0.0`. This is incorrect behavior and breaks msbuild. Instead, now we do the remapping only if the requested version is lower than the runtime version. @akoplinger: This will actually impact xbuild too right now because we're defaulting to xbuild 14.0 in Mono 4.4 now so we'd see messages like Mono: The request to load the assembly Microsoft.Build.Framework v14.0.0.0 was remapped to v4.0.0.0 in the assembly loading log, which will break in very subtle ways. --- diff --git a/mono/metadata/assembly.c b/mono/metadata/assembly.c index 7785abeafa9..db17fabc1b2 100644 --- a/mono/metadata/assembly.c +++ b/mono/metadata/assembly.c @@ -1016,6 +1016,12 @@ mono_assembly_remap_version (MonoAssemblyName *aname, MonoAssemblyName *dest_ana if (aname->major == vset->major && aname->minor == vset->minor && aname->build == vset->build && aname->revision == vset->revision) return aname; + + if (compare_versions (vset, aname) < 0) { + // requested version is newer than current + // runtime version, don't remap + return aname; + } if ((aname->major | aname->minor | aname->build | aname->revision) != 0) mono_trace (G_LOG_LEVEL_WARNING, MONO_TRACE_ASSEMBLY,