Link to home
Start Free TrialLog in
Avatar of brgdotnet
brgdotnetFlag for United States of America

asked on

How to tell if a class is Serialized

Hello Experts,

I am maintaining some C# and VB.net code. I know that by default classes and members are non-serializable; that they can be made serializeable by adding the SerializableAttribute.

I also know that if class B inherits from a serialized class, "class A", that class B is not serialized by default. So here is my question. Is there a way in C# or VB.net to prove that a class is currently not serialized?
Avatar of kaufmed
kaufmed
Flag of United States of America image

What kind of serialization are you talking about? The term "serialization" just means taking the in-memory representation of an object, and transforming that data into a representation that can be stored or transmitted. Being serialized means the data has already undergone that conversion.

Marking a class as "serializable" does nothing to the class itself.
SOLUTION
Avatar of Miguel Oz
Miguel Oz
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of brgdotnet

ASKER

Migquel read this article. By default they are not serialized, you have to place an attribute on them to declare them as serializedL

https://docs.microsoft.com/en-us/dotnet/visual-basic/misc/bc30772
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial