BeginCollectionItemCore icon indicating copy to clipboard operation
BeginCollectionItemCore copied to clipboard

Add netcore3.1 support

Open breiter opened this issue 3 years ago • 0 comments

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.

breiter avatar Jun 16 '21 07:06 breiter