dotnet / dotnet/docfx

[Bug] Solutions with code generator projects fail to build

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

Description

**Describe the bug**
The projects in the solution with the code generators cause DocFX to fail to generate documentation. After updating Microsoft.CodeAnalysis.CSharp from 4.8.0 to 4.9.2, DocFX began to fail to generate documentation if there were projects that referenced a namespace generated by the code generator.

**To Reproduce**
Steps to reproduce the behavior:
1. Clone the [Terminaux](https://github.com/Aptivi/Terminaux) project
2. Install DocFX
3. Execute the `docfx` command, pointing it to the `DocGen/docfx.json` file: `docfx DocGen/docfx.json`

**Expected behavior**
DocFX successfully recognizes all generated code and builds the documentation.

**Context (please complete the following information):**
- OS: Ubuntu in GitHub Actions
- Docfx version: 2.75.2

**Additional context**
The failed build log is [here](https://github.com/Aptivi/Terminaux/commit/eb6bed31ad91d11d3933430bb793972034e24f51) and the docfx.json is [here](https://github.com/Aptivi/Terminaux/blob/main/DocGen/docfx.json). It worked fine before upgrading Microsoft.CodeAnalysis.CSharp from 4.8.0 to 4.9.2 with all the generated code, such as [this](https://aptivi.github.io/Terminaux/api/Terminaux.Sequences.Builder.Types.html).

It looks like that the code generators – Terminaux.ColorDataGen, Terminaux.SequenceTypesGen, and Terminaux.TermInfoGen – didn't generate anything during DocFX's build stage, hence the `error CS0234: The type or namespace name 'Types' does not exist in the namespace 'Terminaux.Sequences.Builder' (are you missing an assembly reference?)` errors.

Previously, all code generators worked perfectly fine as in [this log](https://github.com/Aptivi/Terminaux/actions/runs/8170577787/job/22336978039).

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.