Questions tagged [nuget]

NuGet is a free, open source developer focused package management system for the .NET platform.

NuGet is a free open source developer focused package management system for the .NET platform intent on simplifying the process of incorporating third party libraries into a .NET application during development. NuGet is a member of the ASP.NET Gallery in the Outercurve Foundation.

Get started on nuget.org and find documentation on docs.nuget.org

To see NuGet in action, watch this video from MvcConf 2 and this one from DevDays 2011 Netherlands.

11613 questions
220
votes
5 answers

Retargeting solution from .Net 4.0 to 4.5 - how to retarget the NuGet packages?

I have migrated a solution that is currently targeting .NET 4.0 in VS2010 to VS2012 and now I would like to re-target it to .Net 4.5 What I am not sure about is the NuGet packages. For example EF5, which I updated from EF4 in VS2010 turns out to be…
Ivan Zlatev
  • 13,016
  • 9
  • 41
  • 50
204
votes
24 answers

What do Yellow Warning Triangles mean on Dependencies in Visual Studio 2017?

I have just converted my PCL library to a new .Net Standard library and I have some Yellow Warning triangles on my Dependencies shown below: During the conversion it brought all nuget packages across including dependencies so it could be…
JKennedy
  • 18,150
  • 17
  • 114
  • 198
199
votes
7 answers

How do I install a NuGet package into the second project in a solution?

I'm currently working on a solution that initially contained one project (My.First.Project.Name). I've installed Castle Windsor by executing: Install-Package Castle.Windsor I've just added another project (My.Second.Project.Name) to the solution…
Rob
  • 45,296
  • 24
  • 122
  • 150
193
votes
3 answers

Nuget re-targeting after upgrading from .Net Framework 4.5 to 4.6.1

I have a .net solution with approx 30 projects, all of them targeting .Net Framework 4.5. and each referencing at least 3-4 NuGet packages. We now need to update them to .Net Framework 4.6.1. So here's what I need to know: Do I need to re-target…
Vishal
  • 2,103
  • 2
  • 16
  • 18
190
votes
25 answers

NuGet Package Restore Not Working

I checked in a project on one computer, checked out on another, and find that the binaries installed by NuGet are missing. I could check them in to source control as well, but it looks like there's a better…
Eric J.
  • 147,927
  • 63
  • 340
  • 553
187
votes
19 answers

Unable to Install Any Package in Visual Studio 2015

I've tried every package I could possibly find and none of them will install in my project. I've installed every update listed in the Extensions and Updates list that were available. When I attempt to install SendGrid for example, this is the…
clockwiseq
  • 4,189
  • 9
  • 38
  • 61
187
votes
13 answers

Restoring Nuget References?

I have solution & project in Visual Studio 2012. The project has a file packages.config in the root of the project. For the purposes of this question, lets assume I accidentally removed these libraries from the References section of my…
maxp
  • 24,209
  • 39
  • 123
  • 201
178
votes
34 answers

Can't install nuget package because of "Failed to initialize the PowerShell host"

All of a sudden, I am getting this error when upgrading Nuget packages. None of the fixes that I have come across work. I am using Visual Studio 2013. 'Newtonsoft.Json 6.0.3' already installed. Adding 'Newtonsoft.Json 6.0.3' to…
Mike Flynn
  • 22,342
  • 54
  • 182
  • 341
169
votes
6 answers

How do I get .NET Core projects to copy NuGet references to the build output?

I'm trying to write a plugin system with .NET Core, and one of my requirements are to be able to distribute the plugin DLL along with its dependencies to the user for install. However, I can't figure out how to include my NuGet dependencies as a…
chyyran
  • 2,446
  • 2
  • 21
  • 35
166
votes
6 answers

[A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to... web.config issue

I am getting the following error: [A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to [B]System.Web.WebPages.Razor.Configuration.HostSection. Type A originates from 'System.Web.WebPages.Razor, Version=2.0.0.0, …
Maxim
  • 3,836
  • 6
  • 42
  • 64
165
votes
5 answers

The 'packages' element is not declared

When using asp.net mvc 3 project with vs 2010 I have lots of warnings like the ones below: I wonder if I did something wrong and I need to change something, because this is the out of the box project that comes within Visual Studio. Warning 1 …
Luis Valencia
  • 32,619
  • 93
  • 286
  • 506
159
votes
6 answers

NuGet for solutions with multiple projects

Suppose I have a solution with 3 projects: Core UI Tests Some of the NuGet packages I use will apply to all 3 projects. Some will just apply to UI and Tests, and some will just apply to Tests (like NUnit). What is the right way to set this up…
Paul Stovell
  • 32,377
  • 16
  • 80
  • 108
156
votes
11 answers

How do I delete NuGet packages that are not referenced by any project in my solution?

Somehow during the upgrade to VS2012 and .NET 4.5, I've managed to get NuGet confused. There are packages that appear in the package manager (and the packages folder) that I cannot delete (I believe they are legacy ASP.NET NuGet packages that have…
Howard Pinsley
  • 11,300
  • 15
  • 49
  • 66
154
votes
13 answers

Source unreachable when using the NuGet Package Manager Console

We are moving our package management from manually updating files to NuGet. I am trying to install older versions of packages to match the one we already have in source control. There is no way to do this from the UI so I use the command line to get…
Etienne Maheu
  • 3,235
  • 2
  • 18
  • 24
153
votes
2 answers

What are .NET Platform Extensions on docs.microsoft.com?

There is a framework-level navigation element at Microsoft Docs called ".NET Platform Extensions". It contains docs on recently added APIs like System.IO.Pipelines and System.Threading.Channels for example, as well as a whole bunch of other APIs,…
Fit Dev
  • 3,413
  • 3
  • 30
  • 54