Search code examples
c#nuget-packagenugetgallerymanage-nuget-packages

Download only necessary NuGet packages


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?


Solution

  • 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.