C#文档和未使用的使用

时间:2019-05-03 08:40:09

标签: c# documentation using

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

为了让Intellisense知道标识符所指的含义,并在注释中将类名涂成蓝色,我需要添加正确的using语句,这很有意义。

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

问题在于,如果删除了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

1 个答案:

答案 0 :(得分:0)

您需要在xml注释中使用该类的完全限定名称,以使其被VS IntelliSense识别。