通过使用 include 标签,我试图将我的代码的注释放在单独的文件“docs.xml”中。 但它不起作用。我一直在尝试 C# 和 VB.NET 项目。
这是我的评论文件:
<?xml version="1.0" encoding="utf-8" ?>
<d>
<summary>Demo summary</summary>
</d>
我有一个 ABC 类,只有一个属性演示。在我写的这个属性之前:
/// <include file="docs.xml" path="d/*" />
或在 VB.NET 中:
''' <include file="docs.xml" path="d/*" />
但是 ABC.Demo 的摘要从未出现在 InteliSense/对象浏览器/另一个项目中(如果我引用我的项目)。
我有一种强烈的感觉,我在这里遗漏了一些东西。
附言我试过遵循 XML 文件的“路径[@name=]”模式,但它没有帮助。
最佳答案
也许您当时已经在文档中看到了这一点,但如果我理解正确,您必须执行以下操作:
In Visual Studio, you specify the XML doc comments option in the Build pane of the Project Designer. When the C# compiler sees the tag, it will search for documentation comments in xml_include_tag.doc instead of the current source file.
关于c# - Visual Studio XML 外部注释文件不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20313149/