Skip to content

Add System.Reflection.PathAssemblyResolver support for 'retargetable' assemblies #730

Closed

Description

@vatsan-madhavan

https://github.com/dotnet/corefx/issues/40523#issue-484261911

.assembly extern retargetable mscorlib
{
.publickeytoken = (7C EC 85 D7 BE A7 79 8E ) // |.....y.
.ver 2:0:5:0
}

If any assemblies loaded by MetadataLoadContext were built against some older versions of mscorlib, PathAssemblyResolver will fail to match any newer versions of mscorlib present in assemblyPaths, due to a public key token mismatch. PathAssemblyResolver already supports taking the most recent version for target assemblies with an empty public key token.

https://github.com/dotnet/corefx/blob/master/src/System.Reflection.MetadataLoadContext/src/System/Reflection/PathAssemblyResolver.cs#L80

Add support for most-recent assembly match when assembly being resolved is 'retargetable'.

This was fixed in .NET 5 - dotnet/corefx#40581. We did not take this change into .NET Core 3.1 since the evidence was not clear at that time that this would be a big problem.

Since the release of .NET Core 3.1, several WPF customers have reported that this is a blocking problem.

We would like this fix backported to .NET Core 3.1 as part of an upcoming servicing update.

/cc @ericstj, @nguerrera, @rladuca, @steveharter

Activity

  1. ericstj commented on Dec 10, 2019

    @ericstj
    Member

    @steveharter can you port fca6032 to release/3.1 and drive through servicing process?

  2. transferred this issue fromdotnet/corefxon Dec 10, 2019
  3. added
    untriaged
    on Dec 10, 2019
  4. danmoseley commented on Dec 10, 2019

    @danmoseley
    Contributor

    Moved to dotnet/runtime for centralized query.

    cc @ericstj, @nguerrera, @rladuca, @steveharter since notifications will have gotten lost.

  5. added this to the 3.1.x milestone on Dec 10, 2019
  6. removed
    untriaged
    on Dec 10, 2019
  7. ericstj commented on Dec 10, 2019

    @ericstj
    Member

    Picking this up, discussed in tactics and approved if it makes it in today.

  8. ericstj commented on Dec 12, 2019

    @ericstj
    Member

    Per @mmitche dotnet/corefx#42768 (comment)

    Hold this until 3.1.2, as I think the other fix is slipping too, and aspnetcore is just about ready to go.

  9. added
    untriaged
    on Feb 23, 2020
  10. removed
    untriaged
    on Mar 2, 2020
  11. ericstj commented on Mar 2, 2020

    @ericstj
    Member

    This was fixed in 3.1.2 with package System.Reflection.MetadataLoadContext\4.7.1.

    WPF is still working on picking up the fix in the SDK.

  12. ghost locked as resolved and limited conversation to collaborators on Dec 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions