Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Problem deserializing a custom class "'One of the serialized keys is null."

Thread Tools

Problem deserializing a custom class "'One of the serialized keys is null."

Posts: n/a
Hi All.

We have a custom class which we serialize. This class is regularly updated, and the old requests do not have a problem opening, apart from a couple!!! When it try's to deserialize the class I receive "One of the serialized keys is null". I tried to change the constructor "below" to check if the object is null to change is to a new object and set the value but still have the same error. Any ideas? as we need to keep backward compatibly.

Private Sub New(ByVal Info As SerializationInfo, ByVal Context As StreamingContext)

On Error Resume Next

Dim fieldValue As Object = Nothing

Dim i As Int32

Dim thisType As Type = Me.GetType()

Dim mi As MemberInfo() = FormatterServices.GetSerializableMembers(thisType, Context)

For i = 0 To mi.Length - 1

Dim fi As FieldInfo = mi(i)

fieldValue = Nothing

fieldValue = Info.GetValue(fi.Name, fi.FieldType)

If (Not fieldValue Is Nothing) Then fi.SetValue(Me, fieldValue)


Reply With Quote
sctosh sctosh is offline
Junior Member
Join Date: Oct 2009
Posts: 1

i know how old this thread is. But i have now the same problem as you. On the internet i cant find any details about this problem.

What was your solution to solve this Problem?

Reply With Quote

Thread Tools

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
Dynamic loading of .class files and deserializing of object Goofball Java 1 06-11-2007 06:27 PM
Final field & custom serialized format Ian Pilcher Java 8 02-14-2006 05:28 AM
Problem deserializing file from =?Utf-8?B?U3RldmUgQnVnZGVu?= ASP .Net 2 08-21-2005 01:48 PM
How to control the root name with which an array of a custom class objects are serialized???? Bob Rock ASP .Net Web Services 1 06-04-2004 11:28 PM
Re: Deserializing custom ArrayList type from ViewState... help.. PJ ASP .Net 1 06-25-2003 02:39 PM