You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently it is not possible to resolve TypeRef to TypeDef and ModuleId, even if target assembly already loaded. IMetaDataImport::ResolveTypeRef will not work if assembly with same id loaded more then once. It can happen if assembly loaded in multiple AppDomains (.Net Framework, probably can still be mapped manually by resolving AppDomain for assembly) or if assembly loaded in multiple Assembly Loading Context.
There is no profiler API to get information about belonging assembly to Assembly Loading Context or there relations.
We need method like HRESULT ICorProfilerN::ResolveAssemblyReference([in] AssemblyId scope, [in] mdAssemblyRef reference, [out] AssemblyId *pAssemblyId) or something similar. It may set pAssemblyId to nullprtr if assembl is not resolved yet.
In fact, resolving TypeRef even with that info may be hard, as it additionally may require to properly follow TypeRedirects. Having helper method may be great, something like HRESULT ICorProfilerN::ResolveTypeRef([in] ModuleId scope, [in] mdTypeRef reference, [out] ClassId *pClassId) - or something similar that will work with generics.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Currently it is not possible to resolve TypeRef to TypeDef and ModuleId, even if target assembly already loaded.
IMetaDataImport::ResolveTypeRef
will not work if assembly with same id loaded more then once. It can happen if assembly loaded in multiple AppDomains (.Net Framework, probably can still be mapped manually by resolving AppDomain for assembly) or if assembly loaded in multiple Assembly Loading Context.There is no profiler API to get information about belonging assembly to Assembly Loading Context or there relations.
We need method like
HRESULT ICorProfilerN::ResolveAssemblyReference([in] AssemblyId scope, [in] mdAssemblyRef reference, [out] AssemblyId *pAssemblyId)
or something similar. It may set pAssemblyId to nullprtr if assembl is not resolved yet.In fact, resolving TypeRef even with that info may be hard, as it additionally may require to properly follow TypeRedirects. Having helper method may be great, something like
HRESULT ICorProfilerN::ResolveTypeRef([in] ModuleId scope, [in] mdTypeRef reference, [out] ClassId *pClassId)
- or something similar that will work with generics.Beta Was this translation helpful? Give feedback.
All reactions