question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dependency conflict on Microsoft.Extensions.Logging 1.1.1 -> 2.0.0

See original GitHub issue

I’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)’. image

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: image

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:closed
  • Created 6 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
karolz-mscommented, May 1, 2018

Should be fixed now with 1.4 series release on Nuget. Thanks again for help!!

1reaction
karolz-mscommented, Feb 22, 2018

@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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not load file or assembly Microsoft.Extensions. ...
Version Conflict I think the root cause of the problem could be that Azure Functions has a dependency on the nuget package chain:...
Read more >
Microsoft.Extensions.DependencyInjection.Abstractions 7.0.0
Version Downloads Last updated 8.0.0‑preview.7.23375.6 31,448 13 days ago 8.0.0‑preview.6.23329.7 90,728 a month ago 8.0.0‑preview.5.23280.8 109,377 2 months ago
Read more >
Unable to resolve dependencies of NuGet packages
The cause for this error is that NuGet cache conflicts with the build of the site. Solution. To resolve the problem, perform the...
Read more >
Microsoft.Extensions.Logging 1.1.2
Version Downloads Last updated 8.0.0‑preview.7.23375.6 5,743 2 days ago 8.0.0‑preview.6.23329.7 59,577 a month ago 8.0.0‑preview.5.23280.8 74,207 2 months ago
Read more >
NuGet Warning NU1605
A dependency package specified a version constraint on a higher version of a package than restore ultimately resolved.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found