Skip to content

[Bug] Providing references in metadata still results in warnings for unresolved assembly references #10423

@Herrmel

Description

@Herrmel

Describe the bug
I recently updated to a newer Version of docfx. When building metadata I use the dll's with their xml and now I get a ton of warnings for unresolved assemblies even though I included those in the references property in docfx.json. I realized my problem occurs only when the assemblies referenced are in a different folder.

I looked into the code a bit and could see Docfx currently uses the functionality of ILSpy to resolve all assembly references automaticly independent of the provided references. This works for all assemblies in the same directory and for assemblies of the framework. Assemblies from the references property are only added after this step (via Concat here) and the warnings are already printed in the Method GetReferenceAssemblies before.

The references provided should be included somehow in GetReferenceAssemblies. Also the class UniversalAssemblyResolver used for resolving the references provides an option for additional search paths via the method AddSearchDirectory. It should be pretty simple to provide those directories either as a seperate option or instead of the current format of the references option. What do you think?

To Reproduce
Steps to reproduce the behavior:

  1. Provide an assembly for metadata and a dependend assembly in a different folder.
  2. Provide the assembly in the different folder via the references property in docfx.json
  3. start the metadata step

Expected behavior
No warning since the references assembly was provided.

Actual behavior
The following warning is printed:
warning: InvalidAssemblyReference: Unable to resolve assembly reference {FullyQualifiedAssemblyName}

Context (please complete the following information):

  • OS: Windows
  • Docfx version: 2.78.1
  • .NET version: .NET 8.0

Errors and warnings

warning: InvalidAssemblyReference: Unable to resolve assembly reference {FullyQualifiedAssemblyName}

Metadata

Metadata

Assignees

No one assigned

    Labels

    dotnetGenerate .NET API reference docs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions