It is useful to be able to generate several schema at once. For example, if you have a large number of schema and they are updated to a new version. It can take a long time to go through the schema generation one schema at a time. o building a script can be a considerable time saver.
The example script below allows to select all the schemas of a directory and to generate one by one the corresponding classes. The Parameters variable contains code generation options that you can customize to suit your needs. The documentation that details all the command line options can be found here : Howto run from command-line tool
Step-by-step guide
- Create a file on your disk with the .bat extension
- Edit it to insert the code below which can be used as a basis for building your own script
@echo off set WorkingFolder=c:\temp set Parameters=/p NetCore /classinfiles set Extension=.xsd set X2C=C:\Program Files (x86)\Xsd2Code\xsd2code.exe for %%f in (%WorkingFolder%\*%Extension%) do ( echo "fullname: %%f" echo "%X2C%" %%f %Parameters% "%X2C%" %%f %Parameters% ) pause
/classinfiles in the example below can be removed to generate all the classes in a single file
Related articles
Content by label
There is no content with the specified labels