The FileNotFoundException (which are first-chance handled exceptions and not 
unhandled) are expected - the XmlSerializer looks for a pre-compiled 
serialization assembly before it generates one on the fly.

You can pre-generate serialization assemblies via the Generate serialization 
assembly option on the Build tab of the Project properties.

From: [email protected] [mailto:[email protected]] On 
Behalf Of noonie
Sent: Tuesday, October 11, 2011 10:47 PM
To: ozDotNet
Subject: Re: XMLSerializer error

Greetings,

I have a half-baked memory of this being caused by the serializer choking on 
some complex types.

--
Regards,
noonie

On 12 October 2011 15:44, Mark Hurd 
<[email protected]<mailto:[email protected]>> wrote:
IIRC these are because the XmlSerializer generates the C# code
required for the serialisation and compiles it "on the fly" and the
file not found errors are signals to it that this has not yet been
done.

There may be a fix whereby you ensure the serializer IS pre-compiled.

--
Regards,
Mark Hurd, B.Sc.(Ma.)(Hons.)

On 12 October 2011 14:47, Ian Thomas 
<[email protected]<mailto:[email protected]>> wrote:
> I have a class called root, which describes an XML data structure that I
> read from a disk file into a stream.
>
> All works OK, but this line
>
> Dim xSerializer As New XmlSerializer(GetType(root))
>
> produces two consecutive  System.IO.FileNotFoundException errors. This
> doesn't cause any problems at all, but I'm interested in why this occurs and
> what the fix is.
>
>
>
> ________________________________
>
> Ian Thomas
> Victoria Park, Western Australia

Reply via email to