J
JB
I have written a simple ASP.NET page in C#, and on that page I'm
trying to cast an interface to a class, so I can call methods on the
object that are not part of that interface, but part of the object.
Trouble is, every time I do this, I get an invalid cast exception.
I've stepped through the code, and the GetType().GUID of both the
object I'm casting to, and the object I'm casting from is the same.
Has anyone ever seen this? There are sample everywhere in VB talking
about Option Strict, but that doesn't exist in C#.
Whats even stranger is that I can cut the code out, drop it in a
WinForm, and everything works fine.
trying to cast an interface to a class, so I can call methods on the
object that are not part of that interface, but part of the object.
Trouble is, every time I do this, I get an invalid cast exception.
I've stepped through the code, and the GetType().GUID of both the
object I'm casting to, and the object I'm casting from is the same.
Has anyone ever seen this? There are sample everywhere in VB talking
about Option Strict, but that doesn't exist in C#.
Whats even stranger is that I can cut the code out, drop it in a
WinForm, and everything works fine.