Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
vatsan-madhavan opened this issue Dec 10, 2019 · 5 comments
Assignees
Milestone

Comments

@vatsan-madhavan
Copy link
Member

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

@ericstj
Copy link
Member

ericstj commented Dec 10, 2019

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

@danmoseley danmoseley transferred this issue from dotnet/corefx Dec 10, 2019
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-System.Reflection untriaged New issue has not been triaged by the area owner labels Dec 10, 2019
@danmoseley
Copy link
Member

Moved to dotnet/runtime for centralized query.

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

@danmoseley danmoseley added this to the 3.1.x milestone Dec 10, 2019
@ericstj ericstj assigned ericstj and unassigned steveharter Dec 10, 2019
@ericstj ericstj removed the untriaged New issue has not been triaged by the area owner label Dec 10, 2019
@ericstj
Copy link
Member

ericstj commented Dec 10, 2019

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

@ericstj
Copy link
Member

ericstj commented Dec 12, 2019

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.

@ericstj
Copy link
Member

ericstj commented Mar 2, 2020

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.

@ericstj ericstj closed this as completed Mar 2, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants