Jimmy
Jimmy

Reputation: 3264

how to check schema is in sync with classes generated with XSD.exe?

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

Answers (1)

findcaiyzh
findcaiyzh

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

Related Questions