Re: XML serialisation - error reflecting type

Tech-Archive recommends: Fix windows errors by optimizing your registry



Paul,

Catch the exception and check the InnerException or just ToString() it
and dump it somewhere you can read it.


Stephan



Paul E Collins wrote:
I'm using XmlSerializer.Serialize method from System.Xml.Serialization
on one of my own classes and getting the following error:

"An unhandled exception of type 'System.InvalidOperationException'
occurred in system.xml.dll
Additional information: There was an error reflecting type
'<MyProjectName>.<MyClassName>'."

My class contains various instances of other classes (such as Uri and
Regex), and I know that some of them can't be serialised and must have
[XmlIgnore] applied and custom properties written for them instead,
but there are lots of these (some nested) - is there any way that I
can find out which particular field in which class is causing the
exception?

Eq.

.



Relevant Pages

  • How to serialize an Exception usign XmlSerializer?
    ... private static void HandleException ... An unhandled exception of type 'System.InvalidOperationException' occurred ... There was an error reflecting type ... [Freeware, Games and Humor] ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: evc4 compiler/linker producing corrupt executables
    ... Paul T. ... I have also built an "empty" program ... 0xc00000005 is a data abort exception. ... The corrupt executables are about 28kb, ...
    (microsoft.public.windowsce.embedded)
  • Re: Bypassing startup macros
    ... Is there a command line I can use to open it up without using the macros? ... "Paul B" wrote: ... >> Excel is now throwing an illegal exception preventing me from opening the ... >> Sion Smith ...
    (microsoft.public.excel.programming)
  • Re: Shell_NotifyIcon problem
    ... >> Paul T. ... >>> I am creating a system tray icon using the ... But when exception occurs and i try to delete ... > Rajat Lala ...
    (microsoft.public.windowsce.embedded)
  • Re: evc4 compiler/linker producing corrupt executables
    ... Paul T. ... 0xc00000005 is a data abort exception. ... be dereferencing a wild pointer. ... The corrupt executables are about 28kb, ...
    (microsoft.public.windowsce.embedded)