Thanks, guys (I intended to reply to Mark earlier, with the Sam Kekovich response: "You know it makes sense" - but usual, David gives the definitive explanation and remedy).
I have always ignored 'first chance exception' but now I know what <http://msdn.microsoft.com/en-us/library/system.appdomain.firstchanceexcepti on.aspx> that means, too. _____ Ian Thomas Victoria Park, Western Australia _____ From: [email protected] [mailto:[email protected]] On Behalf Of David Kean Sent: Wednesday, October 12, 2011 2:12 PM To: ozDotNet Subject: RE: XMLSerializer error 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]> 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]> 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
