c# - Visual Studio XML 外部注释文件不起作用

标签 c# xml vb.net include documentation

通过使用 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/

相关文章:

c# - 使用 C# 时阻止用户在文本框中输入数值

java - 我在使用 LibGDX TileMaps 时遇到了困难

vb.net - 如何更改 vb.net 图表中的文本颜色?

PHP 打印/回显后退箭头错误

asp.net - 从 Active Directory 获取电子邮件地址

vb.net - 用户界面消失并出现错误 : out of memory

c# - 使用C#将位图图像和音频流组合成视频的最佳方法

c# - 使用 LINQ 的动态表达式。如何找到厨房?

c# - 在 ASP.NET Core MVC 的 View 中格式化日期

java - 将 View 高度设置为屏幕尺寸的百分比(以编程方式)