开发者

SerializationException is Unhandled Error?

I'm using Visual Studio 2005 with C#. Can anyone please tell me what:

Type 'bar' in Assembly 'foo, Version=5.9.0.25319, Culture=neutral, PublicKeyToken=a3c4e260a36280cd' is not marked as serializable.

means??

Obviously I had to change the names of the classes for proprietary sake, but I'm getting this exception on a line that's similar to:

DisplayedData = class1.staticObject.GetShownDataList();

Does this have to do with the fact that I'm trying to c开发者_开发知识库all a method on a static instance of a class? Class1 is in my project, but staticObject holds a static instance of a class in another project that I'm referencing.

Thank you!


The message means Class bar does not have the Serializable attribute assigned to it. Check the link for an example on how to use it.


The exception is crystal clear. Find the bar class in your source code and give it the [Serializable] attribute. Do pause a minute to consider whether that deserializing an object of that class can work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜