Skip to content

In projects targeting .NET 4.7, the net451 assembly is resolved #123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
alastairs opened this issue Jul 26, 2018 · 1 comment · Fixed by #124
Closed

In projects targeting .NET 4.7, the net451 assembly is resolved #123

alastairs opened this issue Jul 26, 2018 · 1 comment · Fixed by #124

Comments

@alastairs
Copy link
Contributor

When including Serilog.Settings.Configuration 3.0.0-dev in a .NET Framework 4.7.1 (net471) project, NuGet resolves the net451 assembly from the package instead of the netstandard2.0 assembly. This pulls in Microsoft.Extensions.Options.ConfigurationExtensions >= 1.1.2 rather than >= 2.0.0 as defined in the netstandard2.0 assembly. This causes a package conflict in our solution with another project that requires v2.0 of that package. NuGet resolves this dependency to v1.1.2:

There was a conflict between "Microsoft.Extensions.Options.ConfigurationExtensions, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" and "Microsoft.Extensions.Options.ConfigurationExtensions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60".
    "Microsoft.Extensions.Options.ConfigurationExtensions, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" was chosen because it was primary and "Microsoft.Extensions.Options.ConfigurationExtensions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" was not.
    References which depend on "Microsoft.Extensions.Options.ConfigurationExtensions, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" [C:\Users\AlastairSmith\.nuget\packages\microsoft.extensions.options.configurationextensions\1.1.2\lib\netstandard1.1\Microsoft.Extensions.Options.ConfigurationExtensions.dll].
        C:\Users\AlastairSmith\.nuget\packages\microsoft.extensions.options.configurationextensions\1.1.2\lib\netstandard1.1\Microsoft.Extensions.Options.ConfigurationExtensions.dll
        Project file item includes which caused reference "C:\Users\AlastairSmith\.nuget\packages\microsoft.extensions.options.configurationextensions\1.1.2\lib\netstandard1.1\Microsoft.Extensions.Options.ConfigurationExtensions.dll".
            C:\Users\AlastairSmith\.nuget\packages\microsoft.extensions.options.configurationextensions\1.1.2\lib\netstandard1.1\Microsoft.Extensions.Options.ConfigurationExtensions.dll
    References which depend on "Microsoft.Extensions.Options.ConfigurationExtensions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" [].
        F:\code\platform\src\ServiceHost\bin\Debug\netstandard2.0\CH360.Platform.ServiceHost.dll
        Project file item includes which caused reference "F:\code\platform\src\ServiceHost\bin\Debug\netstandard2.0\CH360.Platform.ServiceHost.dll".
            F:\code\platform\src\Queue.Rabbit\bin\Debug\netstandard2.0\CH360.Platform.Queue.Rabbit.dll
            F:\code\platform\src\ServiceHost\bin\Debug\netstandard2.0\CH360.Platform.ServiceHost.dll
@MV10
Copy link
Contributor

MV10 commented Jul 26, 2018

Interestingly, there seems to be a NuGet issue about the exact opposite problem, a net471 project that picks up the netstandard2.0 but they don't want it to: https://github.com/NuGet/docs.microsoft.com-nuget/issues/880

If your issue could be fixed by NuGet packaging changes, I assume it would create the opposite problem for others. Sounds pretty thorny (but I'm not exactly a NuGet packaging expert).

@MV10 MV10 closed this as completed in #124 Jul 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants