Search code examples
.netvisual-studionugetnuget-packagecsproj

Difference between References and Dependencies in Visual Studio 2017


When I create a new ASP.NET Web Application in Visual Studio 2017, I end up with a Solution Explorer containing a References element.

When I create a new ASP.NET Core Web Application in Visual Studio 2017, I end up with a Solution Explorer containing a Dependencies element. Furthermore in this situation, NuGet didn't create local packages folder.

Why this difference? Is it possible to have this same Dependencies element with the ASP.Net Web Application solution?


Solution

  • Why this difference ?

    They are basically no different, they are used to store and manage references. Just as Lex said, the Dependencies is a better way to represent different types of references, we can clearly know where the reference comes from, SDK, nuget, etc. so that we can manage our references more efficiently.

    See the info from Introduction to ASP.NET Core:

    ASP.NET Core is a redesign of ASP.NET 4.x, with architectural changes that result in a leaner, more modular framework.

    .

    Is it possible to have this same Dependencies element with the ASP.Net Web Application solution ?

    Since there is still a bunch of open issues on GitHub regarding support of new csproj format for ASP.NET (non-Core) applications. We could not change the ASP.Net Web Application to the new project type, we could not have the same Dependencies element with the ASP.Net Web Application.

    But if you are interested, you could check this thread for how to convert to the new project type.

    Hope this helps.