Skip to content

[Bug] Solutions with code generator projects fail to build #9775

@AptiviCEO

Description

@AptiviCEO

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 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 and the docfx.json is here. It worked fine before upgrading Microsoft.CodeAnalysis.CSharp from 4.8.0 to 4.9.2 with all the generated code, such as this.

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    dotnet: msbuildmsbuild integration for .NET API reference docs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions