Re: reflection question (advanced)
- From: Matt <m.owens@xxxxxxxxxxx>
- Date: Wed, 17 Oct 2007 15:32:17 -0700
On 17 Oct, 21:38, Jon Skeet [C# MVP] <sk...@xxxxxxxxx> wrote:
Matt <m.ow...@xxxxxxxxxxx> wrote:
Is it possible to write a method which can take both a normal
instansiated type and reflection instansiated type?
For example, the following code doesn't work. It throws a casting
exception claiming that a type cannot be converted to another type
(they are both the same reported type - RoundedRectangle):
I suspect you'll find that they're not *really* the same type though.
Usually this happens if one type was loaded from one DLL, and another
was loaded from a different DLL (possibly with the same name but from a
different directory).
--
Jon Skeet - <sk...@xxxxxxxxx>http://www.pobox.com/~skeet Blog:http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
I see, thanks, that worked - by re-jigging my test code so that each
type derived from a common dll. Excellent. Thanks Jon
.
- References:
- reflection question (advanced)
- From: Matt
- Re: reflection question (advanced)
- From: Jon Skeet [C# MVP]
- reflection question (advanced)
- Prev by Date: Re: Thread.yeild
- Next by Date: Re: About VC# 2005 express "error list"
- Previous by thread: Re: reflection question (advanced)
- Next by thread: About VC# 2005 express "error list"
- Index(es):