Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

.net-core

The recommendation is to use Microsoft.AspNetCore.All in .NET Core 2 as it simplifies dependencies and uses tree shaker magic to not bloat what you publish.

I encountered one issue of moving to it: When using a library that references StackExchange.Redis, I ended up with a conflict as something within Microsoft.AspNetCore.All references StackExchange.Redis.StrongName. See question VS.NET 2017 forces using StackExchange.Redis 1.2.4.0 in ASP.NET 2.0 Core app for further info. If I stick to referencing dependencies individually then I avoid this conflict and can compile.

Other than getting conflicts between things you don't use from Microsoft.AspNetCore.All, what are the other issues could you encounter because of this recommendation?

like image 553
Adam Knights Avatar asked Oct 13 '17 10:10

Adam Knights


People also ask

What is Microsoft ASP.NET Core authorization?

ASP.NET Core authorization provides a simple, declarative role and a rich policy-based model. Authorization is expressed in requirements, and handlers evaluate a user's claims against requirements.

How many requests per second can ASP.NET Core handle?

7+ Million HTTP requests per second from a single server.


1 Answers

IMHO it is not a usual issue since there are not many libraries out there published twice with the same types, in two different packages: one strongly named and one not. Especially being referenced by the metapackage Microsoft.AspNetCore.All 2.0.0

You are definitely not the only one with this StackExchange.Redis issue (I stumbled across it twice already) but the maintainers are planning to drop the StrongName package on version 2.0.

You can try dealing with it with the extern alias approach discussed here.

A quick way around it is to target the same package AspNetCore targets (the StrongName one). In case it's just a project within a solution you work with, it's an easy hack.

Another is to target Microsoft.Extensions.Caching.Redis. That's what the metapackage depends on.

That's until SE.Redis releases version 2.0.0.

like image 133
Bruno Garcia Avatar answered Jan 28 '23 23:01

Bruno Garcia