C# 文档和未使用的 using(s)

C# documentation and unused using(s)

我有一份文档引用了使用 <see /> 标记位于另一个名称空间中的 class。

为了让 Intellisense 知道标识符指的是什么并在注释中将 class 名称涂成蓝色,我需要添加正确的 using 语句,这是有道理的。

但是,Intellisense 还通过淡出将 using 语句标记为未使用,这可能会导致其他用户或某些自动代码清理将其删除。

问题是,如果删除该 using 语句,Intellisense 将不再识别文档中的标识符。

我该如何解决这个问题?谢谢。

编辑 一些例子:

设:

namespace Foo
{
    public class Bar
    {
    }
}

并且:

using Foo; // In use by the documentation, but faded out.

namespace Baz
{
    /// <summary>
    /// See <see cref="Bar"/>
    /// </summary>
    public class UsesBar
    {
    }
}

我正在使用 VS2017

您需要在 xml 注释中使用 class 的完全限定名称才能被 VS IntelliSense 识别。