Dependency conflict on Microsoft.Extensions.Logging 1.1.1 -> 2.0.0
See original GitHub issueI’ve got a Service Fabric project and an Azure Function sharing the same class libraries, and I’ve made a dependency on EventFlow for logging. It works fine for the Service Fabric project, but the Azure Function project crashes whenever the function is triggered with the following message:
Method not found: ‘Microsoft.Extensions.Logging.ILoggerFactory Microsoft.Diagnostics.EventFlow.Inputs.LoggerFactoryExtensions.AddEventFlow(Microsoft.Extensions.Logging.ILoggerFactory, Microsoft.Diagnostics.EventFlow.DiagnosticPipeline)’.
I’ve debugged this by creating a new Azure Function project with EventFlow, which worked fine until I added a dependency on Microsoft.Extensions.Logging 2.0.0.
The code that raises the exception is:
// Configure logging
var loggerFactory = new LoggerFactory()
.AddEventFlow(diagnosticsPipeline);
In my real project I get an implicit dependency on 2.0.0, since I’m using Microsoft.EntityFrameworkCore 2.0.1. If I try to downgrade to Microsoft.Extensions.Logging 1.1.1 I get the following error:
I’ve published the sample app where I reproduced the error here: https://github.com/eloekset/EventFlowFunctionApp1/tree/master And this branch has a dependency on Microsoft.Extensions.Logging 1.1.1: https://github.com/eloekset/EventFlowFunctionApp1/tree/feature/FixRuntimeError
I haven’t yet figured out why the Service Fabric project works fine, when it also has the same dependencies on the class libraries using EFCore 2.0.1. The Service Fabric project hosts a service based on ASP.NET Core having target framework set to net47, and I’ve set the Function App project to net47 as well.
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (4 by maintainers)
Top GitHub Comments
Should be fixed now with 1.4 series release on Nuget. Thanks again for help!!
@eloekset this is very helpful and we here at MS really appreciate your effort.
I am going to try to get to the bottom of this… just probably not this week. So I am going to keep the issue and the PR open for now. Thanks again!