【发布时间】:2011-01-14 17:26:39
【问题描述】:
我的 csproj 中有一个 xsd 文件,xsd.exe 从中生成一个包装器 cs 文件。
我想以某种方式评论 xsd 文件,即 cmets 也插入到生成的包装器类中,因此可以有效地使用 VS intellisense。
这可以使用 xsd.exe 吗?
【问题讨论】:
标签: c# xsd code-generation xsd.exe
我的 csproj 中有一个 xsd 文件,xsd.exe 从中生成一个包装器 cs 文件。
我想以某种方式评论 xsd 文件,即 cmets 也插入到生成的包装器类中,因此可以有效地使用 VS intellisense。
这可以使用 xsd.exe 吗?
【问题讨论】:
标签: c# xsd code-generation xsd.exe
显然这似乎不是possible with xsd.exe:
When generating source code from an XML Schema document,
Xsd.exe ignores the <appinfo> element and its contents.
The same is true for the parent of the <appinfo> element, <annotation>.
我试过了,但没有找到任何方法来强制 xsd.exe 吐出架构中包含的任何文档。
更新
我会尝试XsdDataContractImporter - 也许这可以更好地控制从 xsd 模式生成代码。
【讨论】: