Skip to content

Conversation

breiter
Copy link

@breiter breiter commented Jun 16, 2021

BeginItemCollectionCore 1.0.9 links against netcoreapp2.0 and has a package reference to Microsoft.AspNetCore.All version 2.0.9. The new 1.1.0 net5.0 with a framework reference to Microsoft.AspNetCore.App.

That means if you have a netcoreapp3.1 MVC app with a nuget package reference to BeginItemCollectionCore, you get the 2.0.9 version. It brings with it the Microsoft.AspNetCore.App package version 2.0.9 which includes:

    Microsoft.AspNetCore.All 2.0.9
      -> Microsoft.Extensions.Caching 2.0.2
        -> Microsoft.Extensions.Caching.Redis 2.0.2 [deprecated]
          -> StackExchange.Redis.StrongName 1.2.4 [deprectated]

This creates a problem that prevents the application from compiling if you are using Redis caching because the netcoreapp3.1 Microsoft.NET.Sdk.Web contains a reference to new libraries for Redis caching.

    Microsoft.NET.Sdk.Web
      -> Microsoft.Extensions.Caching
        -> Microsoft.Extensions.Caching.StackExchangeRedis
          -> StackExchange.Redis

Both sets of libraries include the StackExchange.Redis.ConnectionMultiplexer type which causes the compilation to fail:

Startup.cs(49,33): error CS0433: The type 'ConnectionMultiplexer' exists in both 'StackExchange.Redis.StrongName, Version=1.2.4.0, Culture=neutral, PublicKeyToken=c219ff1ca8c2ce46' and 'StackExchange.Redis, Version=2.0.0.0, Culture=neutral, PublicKeyToken=c219ff1ca8c2ce46'

I think the best solution is to build add a netcoreapp3.1 build artifact to your nuget package.

I've modified your csproj files to target both netcoreapp3.1 and net5.0. This completely solves the issue for me.

@saad749 saad749 self-assigned this Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants