Every now and then programmers will get these confusing error messages that can take hours to figure out. I recently ran into one like this. After having implemented a few changes in my program, the program would crash with an error message like:
Type 'SomeNamespace.Web.Data.ProviderDataSourceDeepLoadList' in Assembly
'SomeNamespace.Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
is not marked as serializable
I eventually tried to Google (actually I typically use Bing) the error message without much luck. There were very little information on the net about this particular error message, and I therefore had to figure this one out on my own.
I eventually found the solution to the problem. The thing was that I had replaced a session variable with a variable stored in ViewState. Switching the variable to a Session variable solved the problem and the error disappeared.
Happy debugging :)