What is the best way to generate xsd xml schema from dotnet class?

Usually, when it comes to xml, I write an xsd schema file and generate a C # class using xsd.exe. But it would be much easier to first declare C # classes (classes) with public properties, as necessary for serializing the XmlSerializer. Unfortunately, you are not getting any XML schema to document this output / interface. Generating an xsd schema from a generated XML file is quite error prone because you cannot guess the constraints or constraints. So what is the best way to generate xsd xml schema from dotnet class?

+4
source share
1 answer
xsd.exe assembly.dll /type:Your.Type.Name 
+6
source

Source: https://habr.com/ru/post/1335524/


All Articles