Re: reflection question (advanced)

Tech-Archive recommends: Fix windows errors by optimizing your registry



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

.