我的 csproj 中有一个 xsd 文件,xsd.exe 从中生成一个包装器 cs 文件。
我想以某种方式对 xsd 文件进行注释,这些注释也会插入到生成的包装类中,以便可以有效地使用 VS intellisense。
使用 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 模式生成代码。
关于c# - xsd.exe 生成的包装类中的 .xsd 注释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2227763/