Re: Reflection messing up the type hierarchy
- From: "Emmanuel Stapf [ES]" <manus@xxxxxxxxxxxxxxxxx>
- Date: Fri, 15 Sep 2006 10:53:18 -0700
So far I am still researching the issue and I will update you with new
information ASAP.
BTW: what did you care in your scenario, if you want to to know if the
type
"stdole.StdPictureClass" is a subclass of typeof(object), we can just use
the method IsSubclassOf.
The issue is that we are writting a compiler for .NET and use reflection to
get the type hierarchy. When .NET changes the type hierarchy with a type
that is not public to any other assemblies this is really a problem. But
that's not it, not only the type is not public, but suddenly when you query
t.BaseType.IsPublic you get `true', and you have this new thing called
`IsVisible' in .NET 2.0 that says `false'. I'm wondering what does
`IsVisible' check internally to come up with this answer?
Then the problem we are having is that because reflection tells us type is
public we include it as the parent, but when our compiler tries to find that
parent in mscorlib it fails to find it since it is private.
We have a workaround for now, but this seems very fishy. We go up the type
hierarchy until we find a visible parent and set it to be the parent of that
class. Seems to work so far, but I really don't like it.
Regards,
Manu
.
- Follow-Ups:
- Re: Reflection messing up the type hierarchy
- From: "Peter Huang" [MSFT]
- Re: Reflection messing up the type hierarchy
- References:
- RE: Reflection messing up the type hierarchy
- From: "Peter Huang" [MSFT]
- Re: Reflection messing up the type hierarchy
- From: Emmanuel Stapf [ES]
- Re: Reflection messing up the type hierarchy
- From: "Peter Huang" [MSFT]
- RE: Reflection messing up the type hierarchy
- Prev by Date: Problem getting UserGUID from Exchange OnSave event sink
- Next by Date: How To: C++ DLL function returns Structure Array to VB .NET
- Previous by thread: Re: Reflection messing up the type hierarchy
- Next by thread: Re: Reflection messing up the type hierarchy
- Index(es):
Relevant Pages
|
Loading