beefeater267
Programmer
- Apr 6, 2005
- 79
Hey,
I have a collection called EmployeeCollection which is derived from a class I made called 'DataCollection'
'DataCollection' is derived from a class I made called 'BaseCollection'
'BaseCollection' is declared:
public abstract class BaseCollection : NameObjectCollectionBase, IEnumerable
In 'BaseCollection' i have:
public string Serialize(System.Type type)
{
MemoryStream stream = new MemoryStream();
XmlRootAttribute root = new XmlRootAttribute(type.Name);
root.Namespace = "XmlSerializer xmlSerializer = new XmlSerializer(type, root);
xmlSerializer.Serialize(stream, this);
stream.Position = 0;
StreamReader sr = new StreamReader(stream);
string xml = sr.ReadToEnd();
sr.Close();
return xml;
}
however, when i call the method:
string x = empColl.Serialize(typeof(EmployeeCollection));
I get an error on line:
XmlSerializer xmlSerializer = new XmlSerializer(type, root);
saying:
File or assembly name bayiduly.dll, or one of its dependencies, was not found.
I know this error doesn't tell much.. But anyone have any idea what's going on?
Yes, I have a default indexer and Add method. Please Help. This method works fine on a single Employee object but not on my collection, so it must be something w/ my collection.
Any help out there? Thanks. I'm desparate!
I have a collection called EmployeeCollection which is derived from a class I made called 'DataCollection'
'DataCollection' is derived from a class I made called 'BaseCollection'
'BaseCollection' is declared:
public abstract class BaseCollection : NameObjectCollectionBase, IEnumerable
In 'BaseCollection' i have:
public string Serialize(System.Type type)
{
MemoryStream stream = new MemoryStream();
XmlRootAttribute root = new XmlRootAttribute(type.Name);
root.Namespace = "XmlSerializer xmlSerializer = new XmlSerializer(type, root);
xmlSerializer.Serialize(stream, this);
stream.Position = 0;
StreamReader sr = new StreamReader(stream);
string xml = sr.ReadToEnd();
sr.Close();
return xml;
}
however, when i call the method:
string x = empColl.Serialize(typeof(EmployeeCollection));
I get an error on line:
XmlSerializer xmlSerializer = new XmlSerializer(type, root);
saying:
File or assembly name bayiduly.dll, or one of its dependencies, was not found.
I know this error doesn't tell much.. But anyone have any idea what's going on?
Yes, I have a default indexer and Add method. Please Help. This method works fine on a single Employee object but not on my collection, so it must be something w/ my collection.
Any help out there? Thanks. I'm desparate!