Serialization w/ AppDomains problem

A

Alan Seunarayan

Hello all,
I am trying to serialize a class that I have created, it works fine until I instanciate the class via a new Application Domain's CreateInstanceFrom method. When I attempt to serialize I keep getting this exception....


An unhandled exception of type 'System.Runtime.Serialization.SerializationException' occurred in mscorlib.dll

Additional information: The type System.Runtime.Serialization.SerializationInfo in Assembly mscorlib, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 is not marked as serializable.

Can anyone help ?

Many thanks (in advanced)

Alan Seunarayan
 
D

Dmitriy Lapshin [C# / .NET MVP]

Hello Alan,

For a class to be serializable, all its public members and properties should
be of serializable types.
Your class probably violates this restriction by exposing a property or a
member of type SerializationInfo (hmm, what for?).

Anyway, if you could post some code snippet, you would really facilitate
tracking down the root of the problem.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

Hello all,
I am trying to serialize a class that I have created, it works fine
until I instanciate the class via a new Application Domain's
CreateInstanceFrom method. When I attempt to serialize I keep getting this
exception....


An unhandled exception of type
'System.Runtime.Serialization.SerializationException' occurred in
mscorlib.dll

Additional information: The type
System.Runtime.Serialization.SerializationInfo in Assembly mscorlib,
Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 is not
marked as serializable.

Can anyone help ?

Many thanks (in advanced)

Alan Seunarayan
 
A

Alan Seunarayan

Thanks Dmitry,
Please see on of my previous relpies with the attached code.

Alan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top