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.

10235 questions
186
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
  • 21,629
  • 35
  • 115
  • 191
184
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,049
  • 8
  • 33
  • 57
175
votes
7 answers

How can you find unused NuGet packages in solution?

How can you find the unused NuGet packages in a solution? I've got a number of solutions where there are a lot of installed packages, and a large number of them are flagged as having updates. However, I'm concerned there may be breaking changes, so…
SteveC
  • 13,636
  • 21
  • 86
  • 155
174
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
  • 21,905
  • 50
  • 167
  • 308
169
votes
20 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.
  • 139,555
  • 58
  • 313
  • 529
161
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,516
  • 6
  • 36
  • 58
155
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
  • 31,336
  • 15
  • 76
  • 107
153
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,095
  • 2
  • 15
  • 24
149
votes
15 answers

remove nuget package restore from solution

I added the recent nuget package restore feature to a solution using 'Enable NuGet Package Restore': http://docs.nuget.org/docs/workflows/using-nuget-without-committing-packages However it broke my build server and I didn't have the time to fix it,…
Wiebe Tijsma
  • 9,907
  • 4
  • 51
  • 65
147
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
  • 27,032
  • 76
  • 237
  • 423
146
votes
14 answers

Setting up a common nuget packages folder for all solutions when some projects are included in multiple solutions

I have been using NuGet to retrieve packages from external and internal package sources, which is very convenient. But I have realized that the packages are by default stored per solution, which is very frustrating when some projects with NuGet…
Mats Isaksson
  • 1,819
  • 2
  • 14
  • 15
145
votes
6 answers

How to download a Nuget package without nuget.exe or Visual Studio extension?

How can I download a NuGet package? I don't have the NuGet Visual Studio extension or the command line program nuget.exe. How can I download the .nupack file from the web? As I understand I will be able to extract the .dll files from it (with 7-zip)…
Colonel Panic
  • 119,181
  • 74
  • 363
  • 435
145
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
  • 10,614
  • 15
  • 47
  • 64
143
votes
8 answers

nuget 'packages' element is not declared warning

not a showstopper but when using nuget in a project, it creates a packages.config file with this shape ... your packages this gives a warning in VS The 'packages' element is not…
roundcrisis
  • 16,035
  • 14
  • 55
  • 91
141
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
  • 1,583
  • 2
  • 12
  • 15