[Mono-dev] Error using xsd

Stefano Canepa sc at linux.it
Thu Oct 6 05:33:50 EDT 2011


Dear all,
	I'm trying to generate a .cs based on an xsd but I get following error:

[s.canepa at proj13 VectorGraphicAnimation]$ xsd Vga.xsd /classes
/namespace:VectorGraphicAnimation /language:CS
System.InvalidCastException: Cannot cast from source type to destination
type.
  at
System.Xml.Serialization.XmlSchemaImporter.CollectAttributeUsesNonOverlap (System.Xml.Schema.XmlSchemaObjectCollection
src, System.Xml.Serialization.ClassMap map) [0x00000] in <filename
unknown>:0
  at System.Xml.Serialization.XmlSchemaImporter.ImportAttributes
(System.Xml.XmlQualifiedName typeQName,
System.Xml.Serialization.ClassMap cmap,
System.Xml.Schema.XmlSchemaObjectCollection atts,
System.Xml.Schema.XmlSchemaAnyAttribute anyat,
System.Xml.Serialization.CodeIdentifiers classIds) [0x00000] in
<filename unknown>:0
  at System.Xml.Serialization.XmlSchemaImporter.BuildClassMap
(System.Xml.Serialization.XmlTypeMapping map,
System.Xml.XmlQualifiedName typeQName,
System.Xml.Schema.XmlSchemaComplexType stype) [0x00000] in <filename
unknown>:0
  at System.Xml.Serialization.XmlSchemaImporter.BuildPendingMaps ()
[0x00000] in <filename unknown>:0
  at System.Xml.Serialization.XmlSchemaImporter.ImportTypeCommon
(System.Xml.XmlQualifiedName name, System.Xml.XmlQualifiedName qname,
System.Xml.Schema.XmlSchemaType stype, Boolean isNullable) [0x00000] in
<filename unknown>:0
  at System.Xml.Serialization.XmlSchemaImporter.ImportTypeMapping
(System.Xml.XmlQualifiedName name) [0x00000] in <filename unknown>:0
  at Mono.Util.Driver.GenerateClasses () [0x00000] in <filename unknown>:0
  at Mono.Util.Driver.Run (System.String[] args) [0x00000] in <filename
unknown>:0
  at Mono.Util.Driver.Main (System.String[] args) [0x00000] in <filename
unknown>:0
[s.canepa at proj13 VectorGraphicAnimation]$

What's going wrong?

If you need I can provide the XSD. Microsoft xsd utility generates a
correct cs I can use with mono but I would like to develop on Linux with
mono.

Bye
Stefano

-- 
Stefano Canepa aka sc: sc at linux.it - http://www.stefanocanepa.it
Three great virtues of a programmer: laziness, impatience and hubris.
Le tre grandi virtù di un programmatore: pigrizia, impazienza e
arroganza. (Larry Wall)


More information about the Mono-devel-list mailing list