[Bug] Providing references in metadata still results in warnings for unresolved assembly references
- Dominant language
- C#
- Stars
- 4.4k
- Forks
- 890
- Avg merge
- 2h 9m
- Merged PRs (30d)
- 11
Description
**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](https://github.com/dotnet/docfx/blob/e8bc3a935057044e0a25d39ce8324425a4093172/src/Docfx.Dotnet/CompilationHelper.cs#L120C1-L120C42)) 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}
```
Contributor guide
Assessment
This issue has not been assessed yet.