Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Herrmel opened this issue Nov 25, 2024 · 0 comments
Labels
bug A bug to fix dotnet Generate .NET API reference docs

Comments

@Herrmel
Copy link

Herrmel commented Nov 25, 2024

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}
@Herrmel Herrmel added bug A bug to fix dotnet Generate .NET API reference docs labels Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug to fix dotnet Generate .NET API reference docs
Projects
None yet
Development

No branches or pull requests

1 participant