Avatar of Lawrence Avery
Lawrence AveryFlag for United States of America

asked on 

Serialization of a Derived Class

When serializing a derived class, the members in its base class are serialized too, correct?
If so, does the base class have to have [Serializable] attribute too?
.NET ProgrammingMicrosoft Development

Avatar of undefined
Last Comment
Lawrence Avery
Avatar of kaufmed
kaufmed
Flag of United States of America image

What kind of serialization? Binary? XML?
Avatar of Lawrence Avery

ASKER

Binary
Avatar of kaufmed
kaufmed
Flag of United States of America image

Yes, the base class must be marked as Serializable as well.
Avatar of Lawrence Avery

ASKER

So are you saying if base class is not Serialized, program will not compile or runtime error?

Or  Are you saying --if you only Serialize the derived class, the data declared only within the derived class be serialized?
ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Lawrence Avery

ASKER

Thank you
.NET Programming
.NET Programming

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.

137K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo