When I want to do my own NuGet package with custom authentication scheme, I need to download Microsoft.AspNetCore.Authentication
that contains AuthenticationScheme
class. I need only this one class but together with this package there is downloaded 36 transitive packages. How can I reject these packages? Is it possible?
Asked
Active
Viewed 78 times
0

Szyszka947
- 473
- 2
- 5
- 21
-
3What makes you think that this package will function correctly without its transitive dependencies? – Donut Sep 19 '22 at 17:56
-
Because I really dont think that AuthenticationHandler uses DataProtection, Cryptography, FileProviders and others. – Szyszka947 Sep 19 '22 at 18:11
-
1What makes you think that? Transitive dependencies exist for a reason. – Donut Sep 19 '22 at 18:15
-
I see it by `using`, imported namespaces. But in fact, I checked it in a class that only I need as ignorant. I rushed with this question, sorry. – Szyszka947 Sep 19 '22 at 18:21
1 Answers
4
When you take onboard a new dependency you implicitly takes on its transitive dependencies. If you start messing with it then code you want to depend on will not work. It is just the price you pay for the dependency.

Jocke
- 2,189
- 1
- 16
- 24