Axe*_*ger 44
此链接建议另一种方法...在指定输入模式时使用路径字符会重置生成的文件名.因此,如果您使用以下内容,您将能够控制输出文件名.
xsd.exe schema1.xsd schema2.xsd .\schema3.xsd
Run Code Online (Sandbox Code Playgroud)
将强制xsd.exe
生成schema3.cs
文件.
注意:这是一个黑客,但到目前为止(VS 2010)它的工作原理.
Eoi*_*ell 11
xsd.exe将根据输入文件名自动选择文件的输出名称.您只能使用/ o开关选择将其输出到的目录.
也就是说,将它包装在一个批处理作业中是微不足道的,这可以做你想要的.
rename output.cs yourname.cs
Run Code Online (Sandbox Code Playgroud)
bri*_*ler 11
要添加到AxelEckenberger的答案中,如果您经常这样做(即在批处理脚本中),那么黑客攻击会有很小的改进.使用要使用的输出名称创建一个空模式文件
Output.xsd
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" />
Run Code Online (Sandbox Code Playgroud)
然后您不需要重命名输出
xsd.exe schema1.xsd schema2.xsd schema3.xsd .\Output.xsd
Run Code Online (Sandbox Code Playgroud)
现在输出文件将被命名Output.cs
.