PC Review


Reply
Thread Tools Rate Thread

Serialization error

 
 
=?Utf-8?B?UmljYXJkbw==?=
Guest
Posts: n/a
 
      6th Sep 2005
Hi. I have a class A with an attribute of type B that has an attribute that
is a collection of type C. In B, the attribute that is a collection of C is
marked with the NonSerialized attribute and in A, the attribute that is of
type B is also marked with the NonSerialized attribute.

class A
{
[NonSerialized]
B b;
}

class B
{
[NonSerialized]
C c;
}

class C : IEnumerable
{
....
public void Add(object o) {}
}

I save an object of type A with the Configuration Application Block of
Enterprise Library, which tries to serialize the object. And there comes the
error. The message says that the collection of type C should have an method
Add because it inherits from IEnumerable.
The collection has the method Add and should not be serialized once it is
marked with NonSerialized attribute.
If anyone can understand the problem, can you help me?
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Serialization Error mianiro Microsoft Dot NET Framework 2 27th Feb 2007 07:27 PM
Recursive XML serialization? XML serialization of cyclic objects? =?ISO-8859-1?Q?=22Andr=E9s_G=2E_Aragoneses_=5B_kno Microsoft C# .NET 2 16th Jan 2007 04:52 PM
Serialization and de-serialization of types loaded from assembly at runtime mookid8000@gmail.com Microsoft C# .NET 6 1st Mar 2006 10:27 AM
Serialization Error when going from 1.0 to 1.1 dorutzu Microsoft Dot NET Framework 0 25th May 2004 07:58 PM
Xml Serialization Error ron Microsoft C# .NET 3 9th Sep 2003 03:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:42 PM.