Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / September 2004

Tip: Looking for answers? Try searching our database.

SOAP serialization exception

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tim Anderson - 26 Aug 2004 15:38 GMT
I have an app that uses the SOAP serializer to serialize and deserialize a
object of a certain class to a file. The class implements ISerializable.
From time to time it is necessary to add or remove fields from the class.
I've been able to deserialize out-of-date versions by handling serialization
exceptions in Sub New(ByVal info As SerializationInfo, ByVal context As
StreamingContext).

I've now hit a problem. With the latest version, if I try to deserialize an
out-of-date XML file I get an exception *before* my constructor starts to
run. Visual Studio reports:

A first chance exception of type
'System.Runtime.Serialization.SerializationException' occurred in
system.runtime.serialization.formatters.soap.dll
The message is: Top Object cannot be instantiated for element 'mListColor'.

mListColor is a field that no longer exists; however even if I do the
obvious thing and add it back, I still get the same error.

The serialization and deserialization works fine with newly serialized
files; it is just deserializing the old version that is not working.

How can I troubleshoot this?

Thanks for any advice,

Tim
"Matt Tavis [MSFT]" - 30 Sep 2004 18:30 GMT
Does the type mListColor represents still exist as well?  If not, then that
could be your problem as well.  If that isn't it then please send a more
complete stack trace and a repro if possible.

Thanks.

Matt Tavis

Program Manager
XML Web Services
Microsoft Corporation

--------------------
From: "Tim Anderson" <timjand@hotmail.com>
Subject: SOAP serialization exception
Date: Thu, 26 Aug 2004 15:38:17 +0100
Lines: 31
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Message-ID: <OQkNVp3iEHA.396@TK2MSFTNGP12.phx.gbl>
Newsgroups:
microsoft.public.dotnet.framework.webservices,microsoft.public.dotnet.langua
ges.csharp
NNTP-Posting-Host: onlyconn.gotadsl.co.uk 82.133.123.179
Path:
cpmsftngxa10.phx.gbl!TK2MSFTNGXA02.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP08
phx.gbl!TK2MSFTNGP12.phx.gbl
Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.languages.csharp:268249
microsoft.public.dotnet.framework.webservices:6370
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

I have an app that uses the SOAP serializer to serialize and deserialize a
object of a certain class to a file. The class implements ISerializable.
From time to time it is necessary to add or remove fields from the class.
I've been able to deserialize out-of-date versions by handling serialization
exceptions in Sub New(ByVal info As SerializationInfo, ByVal context As
StreamingContext).

I've now hit a problem. With the latest version, if I try to deserialize an
out-of-date XML file I get an exception *before* my constructor starts to
run. Visual Studio reports:

A first chance exception of type
'System.Runtime.Serialization.SerializationException' occurred in
system.runtime.serialization.formatters.soap.dll
The message is: Top Object cannot be instantiated for element 'mListColor'.

mListColor is a field that no longer exists; however even if I do the
obvious thing and add it back, I still get the same error.

The serialization and deserialization works fine with newly serialized
files; it is just deserializing the old version that is not working.

How can I troubleshoot this?

Thanks for any advice,

Tim

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.