Robert,

Generally, it would help if you posted specifics about the exception youare
catching, together with some code to reproduce the problem.
I am gueesing, however, that you would see the following message upon
examing the Message property if the InnerException of the exception you are
catching:

The property 'Source' on type 'System.Exception' cannot be serialized
because it is decorated with declarative security permission attributes.
Consider using imperative asserts or demands in the property accessors.

The XmlSerializer is designed to work in all environments without special
security privileges. I am guessing that it does not process anything that
would cause problems in more restricted environments.

A more general question though: Why are you trying to serialize an
Exception? Given all the limitations and restrictions of the XmlSerializer
it is best to only serialize types that were explicitly designed to be used
with it.

HTH,
Christoph Schittko
Software Architect
Mshow - a division of InterCall
----- Original Message -----
From: "Rolls, Robert" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, June 23, 2002 11:50 PM
Subject: [DOTNET] XmlSerialisation


> Hi all,
>
> I want to serialise a class using the XmlSerialiser but it fails when I
add
> a public member of type Exception; why can't It serialise an exception
> class, and does anybody have any suggestions on how to best achieve the
> serialisation.
>
> Regards,
> Robert.
>
>
>
>
> **********************************************************************"
> This correspondence is for the named person's use only. It may
> contain confidential or legally privileged information or both. "
> No confidentiality or privilege is waived or lost by any "
> mistransmission.  If you receive this correspondence in error, please
> immediately delete it from your system and notify the sender.  You
> must not disclose, copy or rely on any part of this correspondence
> if you are not the intended recipient.
>
> Any views expressed in this message are those of the individual sender,
> except where the sender expressly, and with authority, states them to
> be the views of Vodafone.
>
> This email has been checked for viruses.
>
****************************************************************************
******************
>
> You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
> subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to