Reputation: 20091
I was looking into a .net core application recently & I found something I probably missed earlier. There are three types of dependencies :
Analyzers are fair enough, but I am not sure about difference between Nuget & SDK dependency since they are also overlapping for same package in both like for Micosoft.AspNetCore.App(2.1.1) is available in both with all it's related dependencies in both SDK & nuget.
This is by default .net core Asp.net web API with docker without any change in pacakages or dependencies.
Why packages are required in two places as dependencies?
Upvotes: 11
Views: 2297
Reputation: 5532
The SDK
part is called Shared Framework
and was introduced in Dotnet Core 2.1
. You can remove duplicate nugets and use same functionality from SDK, or you can override SDK package version by referencing nuget package directly.
For more info and history check this great post from Andrew Lock: Exploring the Microsoft.AspNetCore.App shared framework in ASP.NET Core 2.1 (preview 1)
Upvotes: 0
Reputation: 11
I was wondering the same thing and while I don't have a direct answer to your question, here is what I found.
Here is my summary:
NuGet is an open-source package-management system that simplifies the process of incorporating libraries into a project.
SDK can (and probably should have) Documentation, Tutorials, Debugging assistance in addition to API's and/or Code libraries. i.e. Platform and/or language specific. See What is an SDK
Over at this NuGet versus SDK as a project reference page on Visual Studio Docs, they have a grid comparing and contrasting the two. It got more technical than I could follow, but it gave me a general feeling of what is the right direction for my solution.
Upvotes: 1