NuGet - Newbie issue on large enterprise system - nuget

I just inherited a large enterprise system that appears to use NuGet.
I have just read the basics on what NuGet is so pardon the simpleness of my questions.
Is there a way to tell NuGet to update and install all the packages needed to run the system? I am right now running and seeing what fails then guessing what NuGet packages are missing.
(No, there was no documentation in the enterprise system or many code comments, ugh)

From the package manager console try Update-Package –Project ProjectName
Visual Studio -> Tools -> Library Package Manager -> Package Manager Console
http://nuget.codeplex.com/wikipage?title=Updating%20All%20Packages
If the solution is configured to enable Nuget Package Restore you could also just delete the packages folder and rebuild all which would get everything that you needed. If you need to worry about javascript, configuration, etc... I would try the Update-Package route

Related

Reinstall Nuget Package Manager in Visual Studio 2019

I am facing a problem with my project.
The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?
This has happened before and I solved it by reinstalling the Nuget Package Manager using a command. Unfortunately, I am not finding that command again. I tried to find the solution online but everything I am getting is installing/reinstalling NuGet packages and not package manager.
Found this article: https://forums.asp.net/t/1776324.aspx?How+to+install+upgrade+VS+NuGet+Package+Manager+ but It's not applicable here.
NuGet Package Manager is preinstalled in VS2019 and no separate package to download and install. Also, there's not Extension Manage in VS2019 like older versions.
Please Let me know the command to reinstall NuGet Package Manager in Visual Studio 2019.
Such nuget restore issues can normally fix by deleting the obj folder where the nuget files like project.assets.json, projectname.csproj.nuget.g.targets, projectname.csproj.nuget.g.props, projectname.csproj.nuget.dgspec.json and projectnamecsproj.nuget.cache are stored.
If this still doesn't fix it, delete the hidden .vs folder inside the solution, where Visual Studio stores the user settings for the project.

Where is NuGet in VS2017 Community?

Just installed VS2017 Community edition -- I read some doc saying that NuGet is included -- but I don't see it and don't see how to add it. Should it appear basically as it did in VS2015?
You have to find it in the installer, second tab - "Packages", under the subheading "Code Tools"
You can launch the installer from the Tools menu in VS, it should be the first option.
I had the same issue. When I installed VS 2017, I only had Microsoft Visual Studio Offline Package. I can't remember how I figured it out, but I did. What you have to do is:
Open VS 2017.
Select Tools > NuGet Package Manager > Package Manager Settings.
In Options, select NuGet Package Manager > Package Sources.
Select + next to Available package sources.
Enter these values:
Name: nuget.org
Source: https://api.nuget.org/v3/index.json
Select OK.
Now, when you run Install Package commands, you'll get what you need.
NOTE: In the Package Manager Console, as your Package source, make sure you select All or nuget.org.
It was included as an option, NOT installed by default.
To install NuGet:
1. Tools > Get Tools and Features...
2. Single Component > Code Tools
3. √ NuGet package manager
4. update.
To find NuGet:
- Project > Manage NuGet packages...
- Tools > NuGet Package Manager
Project or Tools
In Visual Studio 2017,
Click on Tools -> Nuget Package Manager -> Package Manager Console :)
For anyone who stumbled across this question while trying to find out where nuget was installed to use it as a CLI, if you didn't install it individually you need to use it through MsBuild.exe's use of /t:restore to for example restore nuget packages. You'll have to install the individual component if you want the full tool and not just calls to a DLL via MSBuild.

What is the effect of Updating NuGet Package Manager on Existing Projects?

I am working on VS2012 and have issue with installing Twilio Package via NuGet. It asks me to update NuGet Package Manager. I am concerned if updating NuGet Package Manager have effect on all the projects that are running without any issue. What are the effects of Package Manager Updates on existing projects or solution.
Coming from the Python world, I will attempt to see if I can help you here. Is the concern that a specific package will no longer be available to you if you do a global update on your NuGet package manager?
Is it possible then for you to install a specific NuGet version in a virtual machine encapsulating the project where you want to run with the Twilio package?
Otherwise, assuming all of the packages you use are regularly maintained, I'm not sure how an update to a package manager would affect them.

Nuget for PowerShell Projects in Visual Studio

How can I install nuget packages for my PowerShell Projects in Visual Studio 2015? I have tried to do it with both the PowerShell Module Project and PowerShell Script Project. I have installed PowerShell Tools for Visual Studio 2015.
When I open these projects, the Default project in the Package Manager Console is empty. Here is a screenshot of what I mean.
When I try to install a nuget package, e.g. Pester, I get the following error.
I know this thread might be outdated and is rather old but my older article with some possible solutions might help here. I tested current state and still, no support inside VS 2015 for PowerShell project and NuGet packages together.
the current state is :
go with https://chocolatey.org/ and install it on your dev box (and CI) => you install pester globally with : choco install pester and update it if needed.
use old packages.config and update by hand version number and run nuget restore (nuget update will no longer work for this type of solution).
version whole pester into repo and call it directly. you can use nuget install pester for this (if you have nuget in path somewhere)
The link : http://rostacik.net/2015/12/16/how-to-use-nuget-packages-even-with-powershell-projects-with-visual-studio-2015/

Difference between Chocolatey and NuGet

Is Chocolatey a higher version of NuGet or a different package manager? Where should I put my open source application? NuGet or Chocolatey?
NuGet is designed to allow you to easily add code libraries to your project. Things like JSON.NET, Entity Framework, etc.
Chocolatey is actually built on top of the NuGet package system, but it is designed to fill a different need. Chocolatey wraps up applications and other executables and makes it easy to install them on your computer. For example, tools like Git, Notepad++, etc. can be easily installed with a command like cinst git.
https://chocolatey.org/packages has a list of all the applications that can be installed.
If you have an open source project which is a library that is to be used in other developers' projects, then you should submit it to NuGet.
If it is an application that users would normally install, then create a Chocolatey package that users can easily install and update from the command line.