473,406 Members | 2,619 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,406 software developers and data experts.

Help with ISerializable help file paragraph.

OK, I give up, the msdn help for custom serialization:

http://msdn2.microsoft.com/en-us/lib...75(VS.90).aspx

Hs the following paragraph on it:

-----
In addition, you should not use default serialization on a class that is
marked with the Serializable attribute and has declarative or imperative
security at the class level or on its constructors. Instead, these classes
should always implement the ISerializable interface.
-----

Why?? Could someone tell me PLEASE what a heck does this mean? Why would
having imperative security at the class level or on its constructors have
anything to do with nothing?? What kind of security is this thing talking
about?

Thank you.
Dec 18 '07 #1
3 1256


"Rene" wrote:
OK, I give up, the msdn help for custom serialization:

http://msdn2.microsoft.com/en-us/lib...75(VS.90).aspx

Hs the following paragraph on it:

-----
In addition, you should not use default serialization on a class that is
marked with the Serializable attribute and has declarative or imperative
security at the class level or on its constructors. Instead, these classes
should always implement the ISerializable interface.
-----

Why?? Could someone tell me PLEASE what a heck does this mean? Why would
having imperative security at the class level or on its constructors have
anything to do with nothing?? What kind of security is this thing talking
about?

Thank you.

My guess is that this is an obtuse way of describing that XML serialization
needs a public default constructor.
>
Dec 19 '07 #2
My guess is that this is an obtuse way of describing that XML serialization
needs a public default constructor.
True: xml serialization *does* need a default ctor, but ISerializable
is for binary serialization (IXmlSerializable is for xml).

I don't claim to fully understand the paragraph myself - I'm just
trying to avoid a red herring...

Marc

Dec 19 '07 #3
Actually, ISerializable is not for binary serialization specifically,
but the serialization engine in System.Runtime.Serialization. This engine
will use reflection to get the internal members of a type, as opposed to Xml
serialization, which only works with the public members. Also, the
serialization engine in System.Runtime.Serialization supports multiple
formatters (soap, binary), whereas there is only one format for XML
Serialization.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Marc Gravell" <ma**********@gmail.comwrote in message
news:2d**********************************@y5g2000h sf.googlegroups.com...
>My guess is that this is an obtuse way of describing that XML
serialization
needs a public default constructor.

True: xml serialization *does* need a default ctor, but ISerializable
is for binary serialization (IXmlSerializable is for xml).

I don't claim to fully understand the paragraph myself - I'm just
trying to avoid a red herring...

Marc

Dec 19 '07 #4

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

Similar topics

0
by: Mike | last post by:
I need to have some links within an xml document to external pages. I have tried with the below xml and xsl documents(the proposed link has a tag called link under paragraph): XML:...
22
by: Jeff Parker | last post by:
I have a web application that for the real estate industry. Here is one of the sites using said application. http://www.wellsre.com As you can see if you click this link here...
0
by: Mike Pollett | last post by:
Hi, I have used the ISerializable interface before and the code below worked fine. Until I derived it from CollectionBase. The code will still serialize and deserialize the properties in this class...
9
by: Dave Veeneman | last post by:
I use binary serialization for file storage in an application I am creating. Right now, I'm using simple serialization with a attribute. Now, let's say I create a later version with a modified...
4
by: Julia | last post by:
Hi, I have a EmailMessage and a UrgentMessage objects both derived from IMessage i also have BadMedia and GoodMedia objects both derived from IMedia GoodMedia:IMedia string Subject string...
0
by: a | last post by:
Hi, I am using a SoapFormatter to serialize a class which has a member that is derived from DictionaryBase. Everything works fine... I can serialize and deserialize. The trouble I have is...
1
by: baroon | last post by:
thaaaaanxxxxxxxxxxxxx very much my friend for help but i hahe something also to help i have programe and i need someone to change it from c to c++ .please i should finish it befor tuesday...
4
by: baroon | last post by:
i need help please this program in c and ineed someone to change it in to c++ (change the format).please i need it as soon as u can before tuesday:) ...
2
by: RRB | last post by:
Hi, I have a class library in which I have classes which implement ISerializable. They all have GetObjectData implementations and constructors to support deserialization. In unit testing this...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
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.