I'm having a very perplexing issue. I'm relatively new to ASP.NET 2.0, so I may just have something configured incorrectly, but this is what's happening:
I have two objects: a MyUser object and a MyFooBar object. I have a DetailsView displaying a MyFooBar object. It can also update the object using the static MyFooBar.Update(MyFooBar obj) method. The static Update method then retrieves the current user (i.e., the MyUser object) from the session (i.e., HttpContext.Current.Session[USER_KEY]). That's where things go bad.
There is an object in the session and it has the correct namespace (i.e., "My.Namespace.MyUser"). In fact, loading the page with the DetailsView successfully references and casts the user object. However, when the Update method is invoked (by the DetailsView), it finds the object, but throws the exception: System.InvalidCastException: Unable to cast object of type
'My.Namespace.MyU ...
Go to the complete details ...