Skip to content

docs: qualify APIs by assembly so shared namespaces stop colliding - #66

Merged
MaceWindu merged 1 commit into
masterfrom
docs/assembly-qualified-uids
Aug 14, 2026
Merged

docs: qualify APIs by assembly so shared namespaces stop colliding#66
MaceWindu merged 1 commit into
masterfrom
docs/assembly-qualified-uids

Conversation

@MaceWindu

Copy link
Copy Markdown
Contributor

Replaces the globalPrefix hack with the assemblyUids / assemblyUidOverride options proposed upstream in dotnet/docfx#11090, and refreshes the vendored docfx build that provides them.

Why

linq2db documents 17 assemblies in one docfx project and many of them declare the same namespaces, most of all LinqToDB. A docfx UID is derived from the fully qualified name of an API alone, so those APIs collide: pages overwrite each other, DuplicateUids is reported, and links to a shared namespace resolve to whichever assembly happened to win. See dotnet/docfx#8966.

What changed

source/docfx.json now uses:

  • assemblyUids — the assemblies whose APIs carry the assembly they are declared in as a component of their UID, as in linq2db.Tools::LinqToDB.Tools.Activity.ActivityStatistics. It is a project level setting because every metadata entry has to agree: an entry mints UIDs for the APIs it references as well as the ones it documents, and a reference that comes out unqualified loses its link with no warning. So every assembly appearing in another assembly's public signatures is listed, not only the ones whose namespaces collide.
  • assemblyUidOverride — the component for the assemblies one entry documents. The four Entity Framework Core entries all build an assembly named linq2db.EntityFrameworkCore, so they cannot be told apart by assembly name, and this is the only thing that separates them.

The assembly is part of the identity, not of the namespace: LinqToDB still reads as LinqToDB in titles, breadcrumbs and links, and only the UID and the file name carry it (:: becomes -- in file names, as : is not legal there). assemblyLabel is left at its default, which shows nothing — the last commit here is the refresh that fixed an upstream default which had been appending (linq2db.Tools) to every namespace label and page title.

LinqToDB.Identity is deliberately absent from assemblyUids: its namespace does not collide and nothing else here references it.

Result

before now
errors 0 0
total warnings 1302 68
InvalidBookmark (dead in-page anchors) 1197 1
Ignore duplicated member 28 0
InvalidAssemblyReference 5 0
DuplicateUids / UidNotFound 0 0

2389 generated API files, 2407 HTML pages. Of the 68 remaining warnings, 61 are MSBuild noise from the projects themselves (duplicate source files, one analyzer load failure) and the rest predate this work: 5 InvalidFileLink from Microsoft Learn relative links inside linq2db's own XML comments, and 1 InvalidBookmark from a hand written #remarks anchor.

docfx/README.md documents how the vendored build is produced and how to trace it back to its source commit, and notes that this folder goes away once these options ship in a released docfx — the source/docfx.json options themselves will not need to change.

The previous vendored build defaulted `assemblyLabel` to `auto`, which resolved to `suffix` for a flattened
layout, so every namespace here read `LinqToDB (linq2db.Tools)` in the table of contents, the page title and
the breadcrumb. This site sets no `assemblyLabel` and never asked for that, and 34 of its 40 namespaces are
declared by a single assembly, so the label disambiguated nothing on most of them.

Upstream now defaults to showing nothing, so the assembly appears only in the UID and the file name, which
is all this site ever needed. `source/docfx.json` needs no option change; its comment is updated to say that
the default is what keeps the namespaces reading as themselves.

`assemblyLabel: shared`, also new upstream, would not change this site: it compares the namespaces of one
`metadata` entry, and every entry here documents one assembly, so the six namespace names that do collide
across entries are invisible to it. `suffix` on those entries is the option if the assembly should ever be
named.

docfx rebuilt from `beda63b23`, the same branch as before with the fix on top. Site rebuilt to confirm:
2389 generated API files and 2407 HTML pages, both unchanged; 0 errors and 68 warnings, the same count as
the previous build; no `DuplicateUids`, `UidNotFound` or `Ignore duplicated member`; and no table of
contents label or page title contains `(linq2db` any more.
@MaceWindu
MaceWindu force-pushed the docs/assembly-qualified-uids branch from 25fa761 to 6fb19e4 Compare August 14, 2026 13:12
@MaceWindu
MaceWindu merged commit 0229f0f into master Aug 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant