[Mono-dev] Error using xsd

Atsushi Eno atsushieno at veritas-vos-liberabit.com
Fri Oct 7 22:18:05 EDT 2011


Yes without the actual xsd we can't do anything.

Atsushi Eno

> 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
>



More information about the Mono-devel-list mailing list