Another Catch 22 from Micros**t?

Another Catch 22 from Micros**t?

am 09.01.2008 10:12:31 von Backwater Geezer

I'm getting runtime error

"Object of type 'ABC.ClassA' cannot be converted to type 'ABC.ClassA'."

In the whole solution there is only one definition of ABC.ClassA.

What is even more strange is that I'm not getting this error every time.

MH

Re: Another Catch 22 from Micros**t?

am 09.01.2008 12:10:24 von unknown

"Backwater Geezer" wrote in message
news:uk4eE$pUIHA.1208@TK2MSFTNGP03.phx.gbl...
> I'm getting runtime error
>
> "Object of type 'ABC.ClassA' cannot be converted to type 'ABC.ClassA'."
>
> In the whole solution there is only one definition of ABC.ClassA.
>
> What is even more strange is that I'm not getting this error every time.

Is this a web application? In that case, there's a cached copy of the
assembly as well. Perhaps the two are not the same.
--
------------------------------------------------------------ --------------------
John Saunders | MVP - Windows Server System - Connected System Developer

Re: Another Catch 22 from Micros**t?

am 10.01.2008 13:15:07 von Adam Benson

Check that your executable cannot find more than one copy of the dll that
defines this object.

If it can, the chances are that the dll has been loaded twice. Some of your
code will be calling into one instance of the dll, some of your code into
the other. Each copy of the dll sees the other copy as an evil twin. Evil
twin dll creates an object which gets passed to other code that uses normal
dll - which refuses the cast.

HTH,

Adam.
=========

"Backwater Geezer" wrote in message
news:uk4eE$pUIHA.1208@TK2MSFTNGP03.phx.gbl...
> I'm getting runtime error
>
> "Object of type 'ABC.ClassA' cannot be converted to type 'ABC.ClassA'."
>
> In the whole solution there is only one definition of ABC.ClassA.
>
> What is even more strange is that I'm not getting this error every time.
>
> MH