473,395 Members | 1,678 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: Serialization with <NonSerialized>

Does this attribute really work?
I'm trying to "deep" serialize one of my objects which has a member variable
pointing to a Form object. I don't want to serialize this form (and I know
that I can't do this anyway because the Form class is not marked as
Serializable). I try marking this member variable with the <NonSerialized>
attribute, but the BinaryFormatter seems to be ignoring this attribute; It
throws an exeption "Class frmReport {some info about the class here} can not
be serialized, because it is not marked as Serializable"
Is there any other way to prevent the serialization of a member variable
that I don't know?
Thanx everyone.
Feb 23 '06 #1
1 1609
Hello, Ehsan,

Are you delegating any of the Form's events to a handler in an object
that is being serialized? This can be a problem, as the serialization
will want to serialize the delegate and then also the form.

Cheers,
Randy
Ehsan wrote:
Does this attribute really work?
I'm trying to "deep" serialize one of my objects which has a member variable
pointing to a Form object. I don't want to serialize this form (and I know
that I can't do this anyway because the Form class is not marked as
Serializable). I try marking this member variable with the <NonSerialized>
attribute, but the BinaryFormatter seems to be ignoring this attribute; It
throws an exeption "Class frmReport {some info about the class here} can not
be serialized, because it is not marked as Serializable"
Is there any other way to prevent the serialization of a member variable
that I don't know?
Thanx everyone.

Feb 23 '06 #2

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

Similar topics

5
by: Samuel R. Neff | last post by:
Is there a way to add the NonSerialized attribute to the "Event" fields that the VB.NET compiler creates when you declare an event? I have a class that we use with binary serialization and we...
44
by: Zytan | last post by:
The docs for List say "The List class is the generic equivalent of the ArrayList class." Since List<is strongly typed, and ArrayList has no type (is that called weakly typed?), I would assume...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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...

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.