Reputation: 3264
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?
Upvotes: 1
Views: 481
Reputation: 647
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#)
Upvotes: 3