代码检查:<inheritdoc /> 的使用无效
此检查会报告无法确定要继承哪些文档的 <inheritdoc /> 标签。 当没有要作为基础的文档候选项,或存在多个候选项且标签未指定要使用哪一个时,会发生该情况。
示例
public interface IFirst
{
void M();
}
public interface ISecond
{
void M();
}
class C : IFirst, ISecond
{
/// <inheritdoc />
public void M() { }
}
public interface IFirst
{
void M();
}
public interface ISecond
{
void M();
}
class C : IFirst, ISecond
{
/// <inheritdoc cref="IFirst.M" />
public void M() { }
}
快速修复
请使用 cref 属性指定基础文档候选项。
2026年 5月 8日