JetBrains Rider 2026.1 Help

代码检查:<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日