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·7a5c561934e089 is not marked as serializable.
Can anyone help ?
Many thanks (in advanced)
Alan Seunarayan
try putting [Serializable] before your class in c#...I
don't know the syntax in vb.net. example
c#
[Serializable]
class MyClass
{
MyClass()
{
}
public void OtherMethod()
{
{
private string y = null;
private string x = null;
}
>-----Original Message-----
>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
Dmitriy Lapshin [C# / .NET MVP] - 20 Dec 2003 10:04 GMT
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.

Signature
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
Alan Seunarayan - 22 Dec 2003 09:33 GMT
Thanks Dmitry,
Please see on of my previous relpies with the attached code.
Alan
> Hello Alan,
>
[quoted text clipped - 26 lines]
>
> Alan Seunarayan