Questions tagged [xsd.exe]

The XML Schema Definition (Xsd.exe) tool generates XML schema or common language runtime classes from XDR, XML, and XSD files, or from classes in a runtime assembly. It is a part of the Microsoft .NET SDK.

References

346 questions
3
votes
2 answers

Unable to generate a temporary class (result=1). error CS0030: Cannot convert type

Identical symptoms to those in this post Basic symptoms are that when I use xsd.exe to create my C# class from my XML, when I attempt to deserialize it, I get this error (it compiles, but produces the error on runtime). Unable to generate a…
SuperSooty
  • 81
  • 4
  • 9
3
votes
1 answer

The same table 'tableName' cannot be the child table in two nested relations

Using XSD.EXE I generated a *.cs file to serialize XML. When I serialize I get the error "The same table 'DefaultFont' cannot be the child table in two nested relations." Why do I receive the error? Can I fix the error without using XSLT…
P.Brian.Mackey
  • 43,228
  • 68
  • 238
  • 348
3
votes
1 answer

xsd.exe class generator issues with multiple xsd files

I have multiple XSD files that describe an object. I want to generate the class from these objects so I can parse an XML that and create that object. I used xsd.exe that Visual Studio provides as follows: xsd /c…
marios
  • 65
  • 1
  • 2
  • 6
3
votes
1 answer

How to manage changes for the ItemChoiceType enum when revising XML schemas?

We are using XSD.EXE to generate runtime classes from an XSD schema for XML serialization. The schema is large and contains many complex types and choice elements. As described in http://msdn.microsoft.com/en-us/magazine/cc164135.aspx, choice…
Michael Levy
  • 13,097
  • 15
  • 66
  • 100
3
votes
4 answers

xsd.exe generates duplicate attributes when run on OFX2 schema

Using the command line: "xsd.exe" "OFX 2.1.1 schema/OFX2_Protocol.xsd" /c /namespace:OFX /nologo" The resulting C# source file fails to build with these errors: D:\blah\OFX2_Protocol.cs(19,6): error CS0579: Duplicate…
Ben Hymers
  • 25,586
  • 16
  • 59
  • 84
3
votes
2 answers

XSD.EXE gives error when Multiple Elements Generation when Files have cross references

I have orbitz (global hotel distribution system) xsd schema and want to generate c#.Net classes from these xsd files. When I use Xsd.Exe or XSD2Code or something else, generated classes copies complex types from imported files to inside, so multiple…
AltugCan
  • 108
  • 6
2
votes
1 answer

xsd.exe generates two files, how to join them into one?

I'm not a big XSD expert.. so I'm using xsd.exe to quickly generate some xsd that I need and then tweaking them a bit (minOccur, etc). But now it has created two XSD files, the main one and an extra one where it defines a complex type. How could I…
Francisco Noriega
  • 13,725
  • 11
  • 47
  • 72
2
votes
2 answers

XML Schema Definition Tool not generating SchemaLocation

Does the xsd.exe tool provided with Visual Studio generate the SchemaLocation attribute (in the xs:import) when generating XSDs from plain old C# objects? I am finding that my XSDs that were generated are not valid because the xs:import will import…
Josh T
  • 55
  • 5
2
votes
2 answers

Visual Studio: generating code upon xsd problems with integers

Can anyone tell me, why integer elements in xsd are being converted in String fields? into [System.Xml.Serialization.XmlElementAttribute(DataType = "integer")] public string OwnerID { get { …
Andrey Khataev
  • 1,303
  • 6
  • 20
  • 46
2
votes
1 answer

SuppressMessage compiler warning CS1591 for generated code (xsd.exe)

I'm using the tool xsd.exe in several projects to generate classes for my data model. When turning on documentation file generation in my csproj the compiler starts to show lots of warnings of type: CS1591:Missing XML comment for publicly visible…
walkslowly
  • 417
  • 1
  • 4
  • 16
2
votes
1 answer

Help With Self Referencing XSD Producing Circular Reference

I am trying to build a C# class from a XSD file. In short I'm getting a circular reference error when trying to execute the XSD.exe tool: Group 'setFilterCondition' from targetNamespace='http://developer.cognos.com /schemas/report/7.0/' has …
Mike G
  • 1,956
  • 1
  • 30
  • 62
2
votes
1 answer

creating class object with included schema using xsd.exe

I have received a XSD schema MainSchema.XSD and also Common.Xsd schema. In MainSchema.xsd i have a following line: And Common.Xsd hold a definition for various types of data like:
aghaux
  • 729
  • 4
  • 14
  • 38
2
votes
0 answers

Can xsd.exe's generated classes identify required attributes

Is it possible to have xsd.exe add "IsNullable=false" to XmlAttributes for fields/properties that are defined in the schema as being required? Xjc adds it to the Java annotation, but I haven't found a way to get Xsd.exe to do something similar. I'm…
John F.
  • 291
  • 1
  • 3
  • 4
2
votes
3 answers

Multiple Versions C# classes/XSD using XSD.exe

I am using XSD.exe to convert a pretty complex XML-Schema (XSD-file) to C# Classes. I am then using XmlSerializer to read XML into memory and work with the data. In the future, the XSD will change. So there will be a new version. I will have to…
a.rlx
  • 54
  • 6
2
votes
0 answers

How to prevent xsd.exe from creating uncompileable C#

I am currently trying to generate C# code using xsd.exe in order to use it with System.Xml.Serialization. The command i am using is the next one: xsd.exe path\to\eExact-XML.xsd /c /namespace:Namespace.Models /o:path\to\Namespace\Models Alas, the…
Wampie Driessen
  • 1,654
  • 1
  • 13
  • 19