Issue:
I'm getting following warning message:
WARNING: Method reference is used with definition return type / parameter. Indicates a likely invalid set of assemblies, consider one of the following
WARNING: - Remove the assembly defining Microsoft.Extensions.DependencyInjection.IServiceCollection from the merge
WARNING: - Add assembly defining Microsoft.Extensions.DependencyInjection.IServiceCollection Microsoft.Extensions.Logging.ILoggingBuilder::get_Services() to the merge
Because ReferenceFixator is failing to map declaring type of ILoggingBuilder::get_Services() method in ReferenceFixator.cs: 436
TypeReference declaringType = Fix(method.DeclaringType);
and it is failing because TypeReference.Scope for method.DeclaringType is Microsoft.Extensions.Logging while type is declared in Microsoft.Extensions.Logging.Abstractions and being forwarded:
// Microsoft.Extensions.Logging, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
[assembly: TypeForwardedTo(typeof(ILoggingBuilder))]
Steps to reproduce:
- Take these assemblies
- Merge them
/target:exe "/lib:%UserProfile%\.nuget\packages\microsoft.netcore.app.ref\6.0.0\ref\net6.0" "/out:Test.dll" "Microsoft.Extensions.Logging.Configuration.dll" "Microsoft.Extensions.DependencyInjection.Abstractions.dll" "Microsoft.Extensions.DependencyInjection.dll" "Microsoft.Extensions.Logging.Abstractions.dll"
libs.zip
Expected:
Type forwarding is respected. Probably type is registered twice in MappingHandler with both scopes when it is forwarded.
Issue:
I'm getting following warning message:
Because
ReferenceFixatoris failing to map declaring type ofILoggingBuilder::get_Services()method in ReferenceFixator.cs: 436and it is failing because
TypeReference.Scopeformethod.DeclaringTypeis Microsoft.Extensions.Logging while type is declared in Microsoft.Extensions.Logging.Abstractions and being forwarded:Steps to reproduce:
libs.zip
Expected:
Type forwarding is respected. Probably type is registered twice in
MappingHandlerwith both scopes when it is forwarded.