473,394 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

XML Serialization of the Exception Class

I am attempting the following:
XmlSerializer ser = new XmlSerializer(typeof(Exception));

I receive the following error:

Message: There was an error reflecting type 'System.Exception'.
Message: The property 'TargetSite' 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.

If I had ANY IDEA in the WORLD what this message is trying to tell me I
would try to

do something about this. Can anyone help me?

Thanks In Advance

dlr

Nov 11 '05 #1
2 7405
Dennis Redfield wrote:
I am attempting the following:
XmlSerializer ser = new XmlSerializer(typeof(Exception));

I receive the following error:

Message: There was an error reflecting type 'System.Exception'.
Message: The property 'TargetSite' 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.


That means Exception class cannot be serialized. afaik in .NET 2.0 this
limitaion is going to be lifted.
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 11 '05 #2
Dennis,

See [0] for the full explanation.

--
HTH
Christoph Schittko [MVP]
Software Architect, .NET Mentor

[0] http://support.microsoft.com/default...b;en-us;326971

"Dennis Redfield" <de*************@acadia-ins.com> wrote in message
news:eh**************@TK2MSFTNGP09.phx.gbl...
I am attempting the following:
XmlSerializer ser = new XmlSerializer(typeof(Exception));

I receive the following error:

Message: There was an error reflecting type 'System.Exception'.
Message: The property 'TargetSite' 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.

If I had ANY IDEA in the WORLD what this message is trying to tell me I
would try to

do something about this. Can anyone help me?

Thanks In Advance

dlr

Nov 11 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Stephan Moeller | last post by:
Hi NG, I serialize the following class over .net remoting: using System; using System.Collections; namespace JobServerLib {
1
by: andrewcw | last post by:
There is an error in XML document (1, 2). I used XML spy to create the XML and XSD. When I asked to have the XML validated it said it was OK. I used the .net SDK to generate the class. I have...
4
by: ron | last post by:
Hi, I have class object that i serialize using the System.Xml.Serialization class. Intermittently the object is not getting serialized correctly, using System.Xml.Serialization classes....
1
by: Opa | last post by:
Hi I'm having problem serialization an object instance which contains a public property on the object type My object hierarchy is many levels deep, so for simplicty I created to following which...
5
by: francois | last post by:
First of all I would to to apologize for resending this post again but I feel like my last post as been spoiled Here I go for my problem: Hi, I have a webservice that I am using and I would...
6
by: Uttam | last post by:
Hello, We are at a very crucial decision making stage to select between .Net and Java. Our requirement is to download a class at runtime on the client computer and execute it using remoting or...
1
by: Tim Anderson | last post by:
I have an app that uses the SOAP serializer to serialize and deserialize a object of a certain class to a file. The class implements ISerializable. From time to time it is necessary to add or...
6
by: John Glover | last post by:
I'm having a very strange problem with XML serialization. I'm writing web services which pass instances of various classes back and forth as parameters and return values of web methods. The...
3
by: Paulo Morgado [MVP] | last post by:
Hi all ..NET Framework 1.1 I have created several types that are serailized to XML as strings. Someting like this: public struct MyInt32 : IXmlSerializable { int value;
0
by: Craig Vermeer | last post by:
Hi all, I'm hoping that someone has seen this before. I wasn't able to find any solutions through my usual channels (I.E Google). I'm getting the following exception in certain situations...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.