What problems could you hit when using Microsoft.AspNetCore.All in .NET Core 2?

The recommendation is to use Microsoft.AspNetCore.All in .NET Core 2, as it simplifies dependencies and uses the magic of a tree shaker so as not to inflate what you publish.

I ran into one problem navigating to it: when using a library that references StackExchange.Redis , I ran into a conflict as something inside the Microsoft.AspNetCore.All links StackExchange.Redis.StrongName . See VS.NET 2017 Question using StackExchange.Redis 1.2.4.0 in an ASP.NET 2.0 Core Application for more information. If I stick to dependency binding separately, I avoid this conflict and can compile.

Apart from conflicts between things that you are not using from Microsoft.AspNetCore.All , what are the other problems you encountered due to this recommendation?

+5
source share
1 answer

IMHO is not an ordinary problem, because there are not many libraries published twice with the same types in two different packages: one is strongly named and the other is not. Especially refers to the meta-package Microsoft.AspNetCore.All 2.0.0

You are definitely not the only StackExchange.Redis with this problem (I stumbled upon it twice already), but the maintainers plan to remove StrongName on version 2.0 .

You can try to handle this with the extern alias discussed approach here .

Most likely, this is aimed at the same AspNetCore targets (StrongName one). If this is just a project within the framework of the solution you are working with, this is an easy hack.

Another is targeting Microsoft.Extensions.Caching.Redis . What the meta package depends on.

This is until SE.Redis releases version 2.0.0.

+4
source

Source: https://habr.com/ru/post/1272590/


All Articles