dotnet / dotnet/docfx

[Bug] Failure with inheritdoc under certiain circumstances

Open
#9,518 2 comments 3 reactions 0 assignees View on GitHub
dotnet: xml-comment
Dominant language
C#
Stars
4.4k
Forks
890
Avg merge
2h 11m
Merged PRs (30d)
10

Description

**Actual behavior**
docfx fails to inherit documentation when is used under certain circumstances:
- inheriting from .net type (e.g. object.ToString(), object.Equals(), etc) and
- project TargetFramework is "netstandard2.0"

![Failure netstd2 ext](https://github.com/dotnet/docfx/assets/17494479/b55362b6-451a-448f-8a55-6280df5991ec)

Please note that doc inheritance **works well**:
- for other TargetFramework, e.g. "net6.0"
- for types created within the project, e.g.
- with Visual Studio hint

![Success1](https://github.com/dotnet/docfx/assets/17494479/d319b297-92ba-42dd-ad07-beefef359a7e)
![Success2](https://github.com/dotnet/docfx/assets/17494479/768c0ad9-ef2d-4759-bc7d-35e8adef7f48)
![Success VS](https://github.com/dotnet/docfx/assets/17494479/dde07d46-5bd5-45c1-ba37-b716987fb478)

**Expected behavior**
Documentation should be inherited like it happens for other target frameworks or for other types.

**To Reproduce**
See minimal sample project here:
https://github.com/Lesnik4u/DocFxInheritdocIssueTest
particularly, see the override MyLibBaseClass.ToString().

```C#
namespace MyClassLibrary
{
/// Description in the BASE class. (TargetFramework = netstandard2.0)
public class MyLibBaseClass
{
/// Description in the BASE class.
public virtual void MyMethod() { }

// inheritdoc FAILURE!
///
public override string ToString() => "";
}

///
public class MyLibChildClass : MyLibBaseClass
{
///
public override void MyMethod() { }
}
}
```

**Context:**
- OS: Windows 10 pro
- Docfx version: v2.73.1
- .NET Core SDK: v6.0.300

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.