tags:

views:

511

answers:

3

Is there a way to control the output filename from xsd.exe?

My specific issue is that if an imported xsd is referenced this is added to the filename.

A: 

No. Only the output folder:

/o[ut]:directoryName

From here.

Mitch Wheat
A: 

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

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

rename output.cs yourname.cs
Eoin Campbell
A: 

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

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

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

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

Obalix