Jim*_*eth 9 .net c# documentation xsd xml-documentation
我正在使用xsd.exe从xsd文件集合生成C#类.xsd文件使用<xsd:documentation>标记来包含有用的描述.例:
<xsd:complexType name="AddressType">
<xsd:annotation>
<xsd:documentation>A formatted or free form address and its intended use.</xsd:documentation>
</xsd:annotation>
Run Code Online (Sandbox Code Playgroud)
不幸的是,所有这些都在生成的C#类中丢失了.有趣的是,每个类都附有一个空的备注文档标记.
/// <remarks/>
Run Code Online (Sandbox Code Playgroud)
如何在生成的C#类中包含此文档(在文档标签中)?
xsd.exe 基于 Codedom。
您可以反汇编 xsd.exe,并在其中添加功能并重新编译。代码相当简单。
我对其进行了修改,以便在生成代码时跳过 xsd 中的一些命名空间。[否则,如果我在另外 2 个 xsd 中包含 common.xsd,则该类将生成两次。]
诚然,我可以访问源代码本身[我是微软的一名开发人员],但是使用反汇编代码,这个过程也应该很简单。