Skip to content

[Bug] NuGet not seen on metadata gen #11038

@Nerus87

Description

@Nerus87

Describe the bug
The problem is that DocFX does not see the NuGet reference as a resource, and it is not generating metadata.
So the usage looks like: A (documentation) -> B (base project) -> C (Nuget reference)
In our case, for local run, we are using Debug, so it's fine because we can execute the script from local to build the whole solution, including documentation (all references are directly to projects, not NuGet packages)
But when building on Azure Pipeline, we always build a solution as a Release with all NuGet references.

Configs
[ProjectB.csproj]

<ItemGroup Condition="'$(Configuration)'=='Debug'">
   <ProjectReference Include="..\..\..\Common\Source\Core.Messages\Core.Messages.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(Configuration)'=='Release'">
  <PackageReference Include="Core" Version="*" />
</ItemGroup>

[docfx.json]

{
    "metadata": [
        {
            "allowCompilationErrors": true, // used for skipping errors as a temp bypass
            "src": [
                {
                    "files": ["ProjectB/ProjectB.csproj"],
                    "src": "../"
                }
            ],
            "dest": "api"
        }
    ],
    "build": {
        "content": [
            {
                "files": [ "*.yml", "*.md", "api/*.yml", "api/*.md", "**/*.yml", "**/*.md" ]
            }
        ],
        "resource": [
            {
                "files": [ "articles/*.jpg", "articles/*.docx", "articles/*.pdf", "articles/**/*.zip" ]
            }
        ],
        "template": "statictoc",
        "dest": "_site"
    }
}

To Reproduce
Steps to reproduce the behavior:

  1. Create project
  2. Publish NuGet
  3. Geneare metadata/api
  4. Build doc

Expected behavior
Should generate metadata without problems.

Context (please complete the following information):

  • OS: Windows
  • Docfx version: [e.g. 2.59.0]

Additional context
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions