Questions tagged [nuget-package]

NuGet is a Visual Studio extension that makes it easy to install and update open source libraries and tools in Visual Studio.

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.

3630 questions
599
votes
12 answers

How can I clear the NuGet package cache using the command line?

I can clear my development computer's NuGet package cache using Visual Studio menu Tools → Options → NuGet Package Manager → General: Clear Package Cache button. I would like to do this on the command line. Unfortunately, I can not find a related…
g.pickardou
  • 32,346
  • 36
  • 123
  • 268
401
votes
5 answers

How can I install an older version of a package via NuGet?

I want to install an older version of a package (Newtonsoft.Json). But NuGet rolls back: PM> Install-Package Newtonsoft.Json -Version 4.0.5 Successfully installed 'Newtonsoft.Json 4.0.5'. Install failed. Rolling back... Install-Package : Already…
Nebide Yildiz
  • 4,031
  • 2
  • 15
  • 12
323
votes
19 answers

Is it possible to change the location of packages for NuGet?

I have the following convention for most of my projects: /src /Solution.sln /SolutionFolder /Project1 /Project2 /etc.. /lib /Moq moq.dll license.txt /Yui-Compressor …
TheCloudlessSky
  • 18,608
  • 15
  • 75
  • 116
313
votes
12 answers

Install a Nuget package in Visual Studio Code

How can I install a Nuget Package in Visual Studio Code? I know in Visual Studio, we can do this through the Nuget Package Manager console, but how do I do it in VS Code?
Gyan Parkash
  • 3,233
  • 2
  • 13
  • 10
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
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
163
votes
13 answers

'nuget' is not recognized but other nuget commands working

I am trying to create a nuget package using http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package#From_a_convention_based_working_directory as a reference. My Package Manger Console in Visual Studio is not allowing me to use…
done_merson
  • 2,800
  • 2
  • 22
  • 30
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
153
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,939
  • 2
  • 14
  • 18
145
votes
10 answers

Add native files from NuGet package to project output directory

I'm trying to create NuGet package for a .Net assembly which does pinvoke to a native win32 dll. I need to pack both the assembly and the native dll with the assembly added to the project references (no problem at this part) and the native dll…
AlonFStackoverflow
  • 1,481
  • 2
  • 10
  • 5
129
votes
5 answers

How can I use NuGet packages in my Azure Functions?

Using Azure Functions, can I reference and use NuGet packages in my C# function?
127
votes
3 answers

How do you include Xml Docs for a class library in a NuGet package?

I am creating a NuGet package for a C# class library, and I would like to include generated Xml Documentation with the library. This is my nuspec file: MyLibrary
John Nelson
  • 5,041
  • 6
  • 27
  • 34
120
votes
8 answers

How to debug code in NuGet package created by me

I have a NuGet package I created and installed in another solution but now I need to debug the code of the package when called from my new solution. I tried referencing the solution of the package but it's not working. I am using Visual Studio 2013.
Yatiac
  • 1,820
  • 3
  • 15
  • 25
118
votes
6 answers

Build NuGet Package automatically including referenced dependencies

I want to run a local/internal NuGet repository. I think I've figured out how to "reuse" existing NuGet packages by including them in a dummy project using NuGet and scanning the package file to grab my locally-cached .nupkg files, but... How do…
drzaus
  • 24,171
  • 16
  • 142
  • 201
117
votes
4 answers

NuGet Package Manager errors when trying to update

Opening VS2010 today, the extension manager notified me of an update for NuGet Package Manager. During the install, I get an 'Installation Failed' with an option to view the log. The key error message I see in that log file is: The signature on the…
Valamas
  • 24,169
  • 25
  • 107
  • 177
1
2 3
99 100