Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

C# Programming

SerializationException


hi,
          I  have a class which uses Microsoft.Win32.RegistryKey
class, and i am trying to Serialize this class but i get the following
Error... anu ponter will be really helpfull..

 Message="Type 'Microsoft.Win32.RegistryKey' in Assembly 'mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is
not marked as serializable."

Thanks
Rohit Sapru

Rohit,

    Well, the exception is obvious.  The RegistryKey class is not meant to
be serialized.

    You will have to tag the field with the NonSerialized attribute, and
then make sure your class will be able to load the information it needs into
that field so that it works correctly when deserialized.

--
          - Nicholas Paldino [.NET/C# MVP]
          - m@spam.guard.caspershouse.com

"sapsy" <Rsa@gmail.com> wrote in message

news:1180459774.643819.307540@k79g2000hse.googlegroups.com...

I have an app that is in .NET 2.0 C#.  But it uses components for .NET
1.1 that handle remoting, etc.

When I run the app I get the following runtime error:

 [SerializationException] Possible Version mismatch. Type
System.Globalization.CompareInfo has 2 members, number of members
deserialized is 3.

Is there anyway to get this to work outside of converting the 1.1
components to .NET 2.0?

Thanks.

--

Don Gollahon

-----------------------------------------------Reply-----------------------------------------------

On May 31, 5:16 pm, "Don Gollahon" <don.golla@nospam.acs-inc.com>
wrote:

Probably your client and server are using the CompareInfo class from
differents framework versions.
If I were you, I would use the AppDomain.CurrentDomain.GetAssemblies()
method to see the assemblies' versions loaded on client and server.

-----------------------------------------------Reply-----------------------------------------------
On May 29, 2:29 pm, sapsy <Rsa@gmail.com> wrote:

> hi,
>           I  have a class which uses Microsoft.Win32.RegistryKey
> class, and i am trying to Serialize this class but i get the following
> Error... anu ponter will be really helpfull..

>  Message="Type 'Microsoft.Win32.RegistryKey' in Assembly 'mscorlib,
> Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is
> not marked as serializable."

> Thanks
> Rohit Sapru

Try to find all references to this type in the object graph and mark
it with the nonserializable attribute.
If you need to serialize this type, you might implement the
ISerializable in the parent object to customize this member
serialization.
Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc