By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,143 Members | 865 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,143 IT Pros & Developers. It's quick & easy.

Serialisation error 'System.InvalidOperationException' - when assembly in Gac also.

P: n/a
Hi,
Strange error with serialisaation on .net 1.1 Sp1 when a the assembly
containing the type is in the Gac as well as on e.g c:\customdlls.

ObjValue in below code is populated with and array of classes which
are defined in an assembly loaded from c:\customdlls using loadfrom.
This same assembly is also in the gac. The below code snippet fails on
last line with error

"An unhandled exception of type 'System.InvalidOperationException'
occurred in system.xml.dll

Additional information: There was an error generating the XML
document.
"

Now if i remove the assembly from the Gac all is well!. I've used
process explorer and can see the assembly beiong loaded from the Gac
when xmlSerializer2.Serialize(writer2, ObjValue); is executed .


Code snippet

DataSet ds2 = new DataSet();
XmlSerializer xmlSerializer2 = new
XmlSerializer(ObjValue.GetType());
StringWriter writer2 = new StringWriter();
xmlSerializer2.Serialize(writer2, ObjValue);
Any ideas?

Regards

John

Feb 2 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.