Search code examples
c#xsdcode-behindxsd2code

Why has an xsd file code behind files. What are they for?


Xsd file

Can anybody explain me why an xsd file has 2 sub files (.cs and .designer.cs) and what they are for?

As for the designer.cs, in our case it is generated by Xsd2Code. Why would you do that?


Solution

  • The assumption there is that the XSD represents a model you want to work with in your code - perhaps with XmlSerializer or as a DataTable. If you don't want that, wipe the "Custom Tool" setting for th xsd file.

    The .designer.cs is usually the generated file; commonly the other .cs is for your partial class additions, but check before editing/removing.