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 with the MetadataLoadContext you can load metadata very quickly but it seems it not straightforward to create real types out of these metadata. Currently I think the approach is to load the runtime assembly in the AssemblyLoadContext and then discover the type by comparing against the AssemblyQualifiedName or the MetadataToken.
For attributes it seems that this is more complicated, you need to get the CustomAttributeData and provide your own methods to create the attribute. The problem is though, first you have to discover the underlying attribute type, find it in the AssemblyLoadContext, then all types in the CustomAttributeData (ConstructorArguments, NamedArguments) are also from the MetadataLoadContext and also need to be discoved in the AssemblyLoadContext.
This is very cumbersome and error prone, if would be nice if some API exists that bridges this missing link.
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 with the
MetadataLoadContext
you can load metadata very quickly but it seems it not straightforward to create real types out of these metadata. Currently I think the approach is to load the runtime assembly in the AssemblyLoadContext and then discover the type by comparing against the AssemblyQualifiedName or the MetadataToken.For attributes it seems that this is more complicated, you need to get the CustomAttributeData and provide your own methods to create the attribute. The problem is though, first you have to discover the underlying attribute type, find it in the AssemblyLoadContext, then all types in the CustomAttributeData (ConstructorArguments, NamedArguments) are also from the MetadataLoadContext and also need to be discoved in the AssemblyLoadContext.
This is very cumbersome and error prone, if would be nice if some API exists that bridges this missing link.
Beta Was this translation helpful? Give feedback.
All reactions