hi all,

I am working to extract code information from CIL using Cecil. Now,
sometimes, I bump into types where resolve() returns null because these are
not present in the set of my analyzed assemblies and looking for their
defining librairies is not possible as I do not know their location. I
cannot discard these types because these still are referenced in the code
that I analyze and I have to present them in my extracted info. So, I need
to create some representation for them. An option is to code like this:

if(typeRef.Resolve() != null)
knownTypes();
else
UnknownTypes();

But that's gonna increase the complexity of my code. I was thinking of
looking into way how to create an extension of a TypeResolver that, when an
actual typeDefinition is absent, returns a custom created typedefinition
from the available information about a type. Is there any way to define
extensions in Cecil for this purpose and where should I start looking? Any
other ideas?

thanx

Usman

P.S: Also, can this idea be generalized for all entities that are used in an
assembly but resolving them is not always possible?

-- 
--
mono-cecil

Reply via email to