Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Distributed Applications / December 2003

Tip: Looking for answers? Try searching our database.

Serialization w/ AppDomains problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alan Seunarayan - 18 Dec 2003 12:34 GMT
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
- 18 Dec 2003 13:29 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.