473,498 Members | 1,714 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SOAPFormatter produces SerializationException: An object cannot be registered twice.

I'm trying to write a preferences-handling infrastructure that
serializes prefs to XML. Basically I want to read in a common
"default" prefs set, then read in the user's prefs and override the
defaults as appropriate. I'm trying to do them both using the
SoapFormatter to [de]serialize. But when I try to read in the user's
prefs after reading the defaults, both from similar Soap files, I get
this exception:

----
System.Runtime.Serialization.SerializationExceptio n: An object cannot
be registered twice.
at System.Runtime.Serialization.ObjectManager.Registe rObject(Object
obj, Int64 objectID, SerializationInfo info, Int64 idOfContainingObj,
MemberInfo member, Int32[] arrayIndex)
at System.Runtime.Serialization.Formatters.Soap.Objec tReader.RegisterObject(Object
obj, ParseRecord pr, ParseRecord objectPr)
at System.Runtime.Serialization.Formatters.Soap.Objec tReader.ParseString(ParseRecord
pr, ParseRecord parentPr)
at System.Runtime.Serialization.Formatters.Soap.Objec tReader.ParseArrayMember(ParseRecord
pr)
at System.Runtime.Serialization.Formatters.Soap.Objec tReader.ParseMember(ParseRecord
pr)
at System.Runtime.Serialization.Formatters.Soap.Objec tReader.Parse(ParseRecord
pr)
at System.Runtime.Serialization.Formatters.Soap.SoapH andler.EndElement(String
prefix, String name, String urn)
at System.Runtime.Serialization.Formatters.Soap.SoapP arser.ParseXml()
at System.Runtime.Serialization.Formatters.Soap.SoapP arser.Run()
at System.Runtime.Serialization.Formatters.Soap.Objec tReader.Deserialize(HeaderHandler
handler, ISerParser serParser)
at System.Runtime.Serialization.Formatters.Soap.SoapF ormatter.Deserialize(Stream
serializationStream, HeaderHandler handler)
at System.Runtime.Serialization.Formatters.Soap.SoapF ormatter.Deserialize(Stream
serializationStream)
at <my code>

An unhandled exception of type 'System.IO.IOException' occurred in
mscorlib.dll
------
<this last line might be unrelated>

Can anyone give me some pointers to help? I can't see why loading in
the same class twice from two separate Soap files would be
illegitimate. Is there any way to override this "class registration"
step the second time, or to allow the 2nd registration to override the
first?

Thanks,

Philip
Nov 12 '05 #1
0 2050

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1038
by: news.microsoft.com | last post by:
I have created an add-in for VS.NET and when it starts I want the add-in to read the options from file. I have created a class (with the attribute set) that contains the options and implemented...
2
4722
by: Wiktor Zychla | last post by:
After signing all my assemblies with strong keys, I've found that the application refuses to deserialize any SOAP serialized data. The message says: Parse error, no assembly associated with the...
1
2276
by: Philip K | last post by:
I was trying to use Soap serialisation to save some systems settings how ever it fails if the settings contain a Font object, works fine if the Font object is not in the object being serialised. ...
0
1424
by: craig | last post by:
Hi, I'm new to all this and having tremendous difficulty trying to deserialize the following: <soap-env:Envelope...
2
3739
by: Phillip Galey | last post by:
I have an object called Place which contains only string properties and has the <Serializable()> flag before the class name declaration. I also have a collection object called Places, which is...
0
1601
by: JackRazz | last post by:
I'm trying to serialize a collection to a file stream by serializing each object individually. The code below works fine with the BinaryFormatter, but the SoapFormatter reads the first object and...
0
1072
by: GrandpaB | last post by:
I have an error that I have not been able to find. Any insight you can offer would be most appreciated. I believe that the problem is associated with the SoapFormatter. The application allows...
3
3975
by: Wiebe Tijsma | last post by:
Hi, I'm trying to serialize a KeyedCollection with the SoapFormatter, however I'm getting the exception: System.Runtime.Serialization.SerializationException: Soap Serializer does not support...
0
1091
by: Alphamacaroon | last post by:
All, I am using the SoapFormatter class to parse/deserialize SOAP/RPC calls from a remote client. The SoapFormatter works like a charm when the message contains simple parameter types (like...
0
7125
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7165
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7205
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5462
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4910
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3093
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
291
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.