dotnet / dotnet/docfx

Xref broken when used as property type

Open
#4,792 2 comments 2 reactions 0 assignees View on GitHub
xref
Dominant language
C#
Stars
4.4k
Forks
890
Avg merge
2h 11m
Merged PRs (30d)
10

Description

**Operating System**: Windows

**DocFX Version Used**: 2.43.2

**Template used**: `default`

**Steps to Reproduce**:

(Zip file attached with relevant files.)
[MissingReferences.zip](https://github.com/dotnet/docfx/files/3321736/MissingReferences.zip)

1. Create two library projects, Library1 and Library2, where Library1 depends on Library2
2. In Library2, create classes `Target1` and `Target2` with suitable documentation
3. In Library1, create class `Consumer` with two properties - one that has a declared type of `object` but with a doc comment that references `Target1`; the other property has a declared type of `Target2` and also references `Target2` in the doc comment
4. Create two docfx.json files, one per project, with an `xref` property in Library1's file to refer to xrefmap.yml in Library2
5. Build Library2's metadata and site, then Library1's metadata and site:

```sh
$ rm -rf */obj */bin
$ dotnet build Library1
$ docfx.2.43.2/docfx.exe metadata -f Library2/docfx.json
$ docfx.2.43.2/docfx.exe build Library2/docfx.json
$ docfx.2.43.2/docfx.exe metadata -f Library1/docfx.json
$ docfx.2.43.2/docfx.exe build Library1/docfx.json && docfx.2.43.2/docfx.exe serve Library1/obj/site
```

**Expected Behavior**:

Both `Target1` and `Target2` should be resolved as cross references.

**Actual Behavior**:

`Target1` is referenced correctly; `Target2` is *not* referenced correctly either in the property type or the comment.

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.