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.

貢獻者指南