Friday, January 15, 2010

Compiling XSDDiagram

I was trying to get XSDDiagram to run on my debian/linux box:

http://regis.cosnier.free.fr/?page=XSDDiagram

Here is what I did:

$ mono-csc -g *.cs Properties/*.cs XSD/*.cs -r:System.Data,System.Drawing,System.Windows.Forms,System.Xml

$ resgen -compile AboutForm.resx DiagramControlContainer.resx DiagramControl.resx ElementsForm.resx ErrorReportForm.resx MainForm.resx

$ mono ./AboutForm.exe

However I am stuck with this error:
Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for XSDDiagram.MainForm ---> System.InvalidOperationException: There was an error reflecting type 'XMLSchema.schema'. ---> System.InvalidOperationException: There was an error reflecting field 'Items1'. ---> System.InvalidOperationException: The XML element named 'annotation' from namespace 'http://www.w3.org/2001/XMLSchema' is already present in the current scope. Use XML attributes to specify another XML name or namespace for the element.
at System.Xml.Serialization.ClassMap.AddMember (System.Xml.Serialization.XmlTypeMapMember member) [0x00000]
at System.Xml.Serialization.XmlReflectionImporter.ImportClassMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) [0x00000]
--- End of inner exception stack trace ---
at System.Xml.Serialization.XmlReflectionImporter.ImportClassMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) [0x00000]
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) [0x00000]
--- End of inner exception stack trace ---
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) [0x00000]
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Type type, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) [0x00000]
at System.Xml.Serialization.XmlSerializer..ctor (System.Type type, System.Xml.Serialization.XmlAttributeOverrides overrides, System.Type[] extraTypes, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) [0x00000]
at System.Xml.Serialization.XmlSerializer..ctor (System.Type type) [0x00000]
at XSDDiagram.MainForm..cctor () [0x00000]
--- End of inner exception stack trace ---
at XSDDiagram.Program.Main () [0x00000]

No comments: