473,802 Members | 2,117 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 SerializationIn fo, ByVal Context As StreamingContex t)

On Error Resume Next

Dim fieldValue As Object = Nothing

Dim i As Int32

Dim thisType As Type = Me.GetType()

Dim mi As MemberInfo() = FormatterServic es.GetSerializa bleMembers(this Type, Context)

For i = 0 To mi.Length - 1

Dim fi As FieldInfo = mi(i)

fieldValue = Nothing

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

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

Next

Jul 21 '06 #1
0 1185

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

Similar topics

3
1828
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 frm.getAttribute("custom") => returns the value of the attribute
5
1652
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 still there. Maybe y'all have some ideas? Background ========== The basic idea behind templates, of course, is that much code is independent
1
1751
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 create is an option to add a StronglyTypedCollection class. Thanks. Mark Sanders
14
3169
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 it makes difference to explicitly put them to null after working with them is done - it somehow makes the GC collect them sooner, like here: void SomeFunc() { MyClass c = new MyClass();
0
2988
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 binding 'controllerSoapBinding' from namespace 'http://Bla-Bla-Bla'. Unable to import operation 'getClient'. The datatype 'Array' is missing. " Some problem when I try to use wsdl.exe tool in .NET. I get: Schema validation warning: Type 'cww:Class' is...
2
1256
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 and I need to distinguish types of passed parameters, which can have "null" values: int Wrapper::Call(String *method, System::Object *args) { // ... // args can be null for(int i = 0, nCount = args->Count; i < nCount; i++)
1
2968
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 use the XML Dom API. But are there any other options because I see that for example to read a setting called as "Connectionstring" in web.config we use ....... System.Configuration.ConfigurationSettings.AppSettings; Similarly how can I use this...
5
2898
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
1947
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 associated with Xml key a1:http://schemas.microsoft.com/clr/nsassem/Company.Printing/Printing%2C%20Version%3D2.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dc8c9a20b0583cd1d TemplateManager
0
9699
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9562
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10536
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10063
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7598
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4270
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3792
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2966
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.