Pranav Singh
Pranav Singh

Reputation: 20091

Difference between Nuget & SDK dependencies in .Net Core project

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.

enter image description here

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

Answers (2)

Artur
Artur

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

SqRL
SqRL

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 feels (to me)
    • more lightweight
      • no built-in documentation
    • portable
  • SDK feels
    • more robust
      • Documentation, better Intellisense support, examples, tutorials etc.
    • tightly coupled
      • connected to specific platform or language
      • the Android SDK won't help develpment in iOS and vice versa

Research

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

Related Questions