dotnet/runtime

Support resolving metadata tokens in MetadataLoadContext

Open

#87 657 ouverte le 15 juin 2023

Voir sur GitHub
 (9 commentaires) (10 réactions) (0 assignés)C# (5 445 forks)batch import
area-System.Reflectionfeature-requesthelp wanted

Métriques du dépôt

Stars
 (17 886 stars)
Métriques de merge PR
 (Merge moyen 12j 11h) (661 PRs mergées en 30 j)

Description

When using MetadataLoadContext, Module.{ResolveType,ResolveMember,ResolveMethod,ResolveField,ResolveSignature,ResolveString} all throw NotSupportedException.

This is inconvenient for advanced reflection scenarios. For example, if you are scanning IL code (perhaps retrieved using MethodBody.GetILAsByteArray), these methods are the only way to resolve MemberRefs and TypeRefs used in IL.

I do not think there is a technical reason that prevents these methods from working. If everything looks OK with this idea then I am happy to implement these.

Guide contributeur