473,395 Members | 1,688 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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

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)

Next

Jul 21 '06 #1
0 1160

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

Similar topics

3
by: F. Da Costa | last post by:
Hi, I was wondering *why* there is a difference between the results of the following two statements. On the suface they seem to do the same (or do they?) frm => returns void ...
5
by: Michael Olea | last post by:
Here is a design problem I ran into this am - and I have cleaned the bathroom, scrubbed toilet sink and tub, windexed all glass, mopped the floor, and vacuumed the house - no dice, the problem is...
1
by: Mark Sanders | last post by:
I am wanting to create my own "Item" for use in the "File|Add New Item" dialog window. Does anyone know of any resources which would point me in the right direction? FYI: The item I want to...
14
by: MuZZy | last post by:
Hi, Lately i've been (and still am) fixing some memory leaks problems in the project i just took over when i got this new job. Among the other issues i've noticed that for localy created objects...
0
by: maxim mat | last post by:
Hi I need to build client for web service. But when I'm using Visual Studio .NET to add Web Reference, I get error: "Custom tool error: Unable to import WebService/Schema. Unable to import...
2
by: Stanislav Simicek | last post by:
Hello, I'd like to know, whether it is possible to have type information associated with "null". I am implementing a wrapper (MC++) for our legacy method that accepts variable number of arguments...
1
by: Diffident | last post by:
Hello All, I have created my own custom configuration file. I would like to know about API available to read that config file. Since config file is nothing but an XML file, I could definitetly...
5
by: Lars Netzel | last post by:
Hey! I have tried...(in a datagrid) e.KeyDate.Return and e.KeyDate.TAB end e.KeyDate.Enter
1
by: Mike9900 | last post by:
Hello, We have a serialized XML from version 1.1 of .NET Framework and want to deserialize it in .NET Framework 2.0, but it failes to do so with the following error: Parse Error, no assembly...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.