Skip to content

Conditional Microsoft.Extensions.Logging.Abstractions inclusion based on netcoreapp2.1 targeting #10

Open
@Eric-Bonneau

Description

@Eric-Bonneau

Hi there,

We're having some issues right now with a netcoreapp2.2 app with Microsoft.NET.Sdk.Web as project using LaunchDarkly.ServerSdk version 6.3.2. This server SDK version uses LaunchDarkly.Logging version 1.0.1. From what I can see on this line, it looks like you're explicitly including Microsoft.Extensions.Logging.Abstractions at version 3.1.9 for apps using netcoreapp2.1. I'm not exactly sure why this is affecting my app that is using netcoreapp2.2, but nevertheless, the error that I'm seeing is:

Severity	Code	Description	Project	File	Line	Suppression State
Error	NU1107	Version conflict detected for Microsoft.Extensions.Logging.Abstractions. Install/reference Microsoft.Extensions.Logging.Abstractions 3.1.9 directly to project MyProject to resolve this issue. 
 MyProject -> LaunchDarkly.ServerSdk 6.3.2 -> LaunchDarkly.Logging 1.0.1 -> Microsoft.Extensions.Logging.Abstractions (>= 3.1.9) 
 MyProject -> Microsoft.AspNetCore.App 2.2.0 -> Microsoft.Extensions.Logging.Abstractions (>= 2.2.0 && < 2.3.0).		

If I add Microsoft.Extensions.Logging.Abstractions version 3.1.9 directly to my project, I get this warning when building:

warning NU1608: Detected package version outside of dependency constraint: Microsoft.AspNetCore.App 2.2.0 requires Microsoft.Extensions.Logging.Abstractions (>= 2.2.0 && < 2.3.0) but version Microsoft.Extensions.Logging.Abstractions 3.1.19 was resolved.

This builds, but ultimately leads to runtime errors.

From what I've understood, these Microsoft.Extensions.* packages are versioned in line with the current .NET Core (and now .NET) versioning scheme. So I would expect that if you're doing conditional targeting for netcoreapp2.1, the package version should be the latest within the 2.1.* line (or just use 2.1.* within the .csproj to get the latest version).

Am I misunderstanding something?

I know you don't officially support netcoreapp2.2, but I feel like there must be some way to have conditional targeting to allow for 2.* versions of the Microsoft.Extensions.Logging.Abstractions package. It would really help to unblock me, and possibly others in the 2.* version line of .NET Core.

I suspect this issue will mostly go away in .NET Core 3.* and up since it seems like you no longer need to add these packages explicitly; they are added automatically as part of the Microsoft.NET.Sdk.Webproject.

Please let me know what you think, or if there is anything I can do to help.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions