How to get IAssembly from ITypeDefinition

Topics: Metadata Model
Sep 20, 2013 at 3:50 PM
Edited Sep 23, 2013 at 8:26 AM
I've retrieved the an ITypeDefinition and I'm trying to get the IAssembly, is there a way to do this, or do I have to track myself which IAssembly the ITypeDefinition comes from?

Thanks,

Patrik

Edit:

I did some more poking around and managed to come up with this:

INamespaceTypeDefinition nsTypeDef = (INamespaceTypeDefinition)type;
IAssembly typeAsm = (IAssembly)nsTypeDef.Container.RootOwner;

Which at least worked for my one test-case so far.