[ACCEPTED]-xsd.exe output filename-xsd.exe

Accepted answer
Score: 53

This link suggests another alternative ... using 6 a path character in specifying the input 5 schemas resets the generated file name. So 4 if you use the following you will be able 3 to control your output file name.

xsd.exe schema1.xsd schema2.xsd .\schema3.xsd

Will force 2 xsd.exe to generate the schema3.cs file.

Note: It's a hack but 1 up to now (VS 2010) it works.

Score: 14

To add to AxelEckenberger's answer there 7 is a very slight improvement on the hack 6 if you are doing this regularly (i.e in 5 a batch script). Create an empty schema 4 file with the output name that you want 3 to use

Output.xsd

<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" />

Then you don't need to rename the 2 output

xsd.exe schema1.xsd schema2.xsd schema3.xsd .\Output.xsd

Now the output file will be named 1 Output.cs.

Score: 11

xsd.exe will automatically choose the output 5 name of the file based on the input file 4 name. You can only choose what directory 3 to output it to with the /o switch.

That 2 said, it's trivial to wrap this in a batch 1 job, that would do what you want.

rename output.cs yourname.cs
Score: 7

Update: Please see @Obalix's answer.

No. Only the 1 output folder:

/o[ut]:directoryName

From here.

More Related questions