Problem with XMLSerializer

D

David Pendleton

Hello all.

The following code...

Dim objXMLSerializer As XmlSerializer

objXMLSerializer = New XmlSerializer(GetType(Settings))

....generates the following exception in my application...

An unhandled exception of type 'System.IO.FileNotFoundException'
occurred in mscorlib.dll
Additional information: File or assembly name twcpkrac.dll, or one of
its dependencies, was not found.

The DLL name is always a 'random' string of characters.

Any ideas why?
 
D

Doug Perkes

I always use something similar to this when creating a serializer...

objXMLSerializer = New XmlSerializer(Settings.GetType())

I don't know if that would make a difference, but it is worth a shot.

HTH,

Doug Perkes
 
D

David Pendleton

I found the problem, but am unsure about the details behind it.

My class, 'Settings' was declared within my Form class. Apparently, this is
a no-no as far as serialization is concerned; it worked fine once I moved it
to it's own class module.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top