dotnet/runtime

Support resolving metadata tokens in MetadataLoadContext

开放

#87,657 创建于 2023年6月15日

 (9 条评论) (10 个反应) (0 位负责人)C# (5,445 个派生)batch import
area-System.Reflectionfeature-requesthelp wanted

仓库指标

星标
 (17,886 个星标)
PR 合并指标
 (平均合并 12天 11小时) (30 天内合并 661 个 PR)

描述

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.

贡献者指南