dotnet / dotnet/docfx

[Bug] Inheritance relation beyond namespaces/assemblies is not properly treated

Open
#8,402 1 comment 0 reactions 0 assignees View on GitHub
dotnet
Dominant language
C#
Stars
4.4k
Forks
890
Avg merge
2h 9m
Merged PRs (30d)
11

Description

**[Bug Description]**
Inheritance relation looks not properly taken into account for a class derived from an base class that belongs to another namespace/assembly; and, instead, treated as if it were derived directly from System.Object.
```
Inheritance
---------------------------------------
object
+ DerivedClass // <- incorrect

Syntax
---------------------------------------
public class Derived : Base // <- correct

```

**[To Reproduce]**
Such an output is generated from the following source code:
```
// Base.dll built under Base.csproj
namespace Base;
public class BaseClass
{
public void BaseMethod() { }
}

// Derived.dll built under Derived.csproj
using Base;
namespace Derived;
public class DerivedClass : BaseClass { }
```

**[Expected behavior]**
Output shall be displayed as follows:
```
Inheritance
---------------------------------------
object
+ BaseClass
+ DerivedClass

Inherited Members
---------------------------------------
BaseClass.BaseMethod()

Syntax
---------------------------------------
public class Derived : Base
```

**[Context]**
- OS: Windows 10 or 11
- Framework: .NET 6 or 7
- Docfx version: 2.61.0

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.