Problem serializing class to XML

D

Derrick

Hello all;

I seem to be having some trouble serializing a class to XML. This code is a
cut & paste from a project which used it perfectly, but all of a sudden I'm
getting an error that the "dll ogerh_f6.dll or one of its dependancies
cannot be found". The class I'm serializing is quite simple, with a couple
of string properties marked with the XmlElementAttribute. The class is
marked with the Serializable attribute. As such, I don't believe the class
is the problem - as I mentioned, I've used this exact code successfully
before.

The code is blowing up when I try to create an instance of the XmlSerializer
class. I have no idea what the ogerh_f6.dll file is or does. I searched
Google for it to no avail.

Any idea where I should be looking?

The code and error is below.

Thanks,

Derrick



public void Save()

{

if(!Directory.Exists(settingsLocation))

{

Directory.CreateDirectory(settingsLocation);

}

using(TextWriter tw = File.CreateText(settingsLocation + settingsFile))

{

XmlSerializer xs = new XmlSerializer(typeof(ReaderHistory));
//Blowing up here

xs.Serialize(tw,this);

}


}


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

Derrick

Derrick said:
Hello all;

I seem to be having some trouble serializing a class to XML. This code is
a cut & paste from a project which used it perfectly, but all of a sudden
I'm getting an error that the "dll ogerh_f6.dll or one of its dependancies
cannot be found". The class I'm serializing is quite simple, with a
couple of string properties marked with the XmlElementAttribute. The
class is marked with the Serializable attribute. As such, I don't believe
the class is the problem - as I mentioned, I've used this exact code
successfully before.

The code is blowing up when I try to create an instance of the
XmlSerializer class. I have no idea what the ogerh_f6.dll file is or
does. I searched Google for it to no avail.

Any idea where I should be looking?

The code and error is below.

Thanks,

Derrick



public void Save()

{

if(!Directory.Exists(settingsLocation))

{

Directory.CreateDirectory(settingsLocation);

}

using(TextWriter tw = File.CreateText(settingsLocation + settingsFile))

{

XmlSerializer xs = new XmlSerializer(typeof(ReaderHistory));
//Blowing up here

xs.Serialize(tw,this);

}


}


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

Fixed it....seems the class got modified to provide a Singleton instance,
thus having a private constructor. Changing the constructor back to public
fixed everything.

Derrick
 

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