how to check schema is in sync with classes generated with XSD.exe?
Domanda
I am using classes generated with XSD.exe from schema(xsd file) for serializing/deserializing XML. Recently I had some issues becasue the schema changed but I missed to regenerate the classes.
I am wondering what is the best way to make sure the schema and classes are in sync? How can I check this in runtime and compiletime?
Soluzione
Generate classes according xsd file in Pre-build event command line of build events page of project properties. In this way, classes is always sync with schema.
Here are some useful link:
Pre-build Event/Post-build Event Command Line Dialog Box
How to: Specify Build Events (C#, J#)
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow