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

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.

Related

Why is the latest stable version of Newtonsoft showing in Nuget Package Manager as 12.0.3 in one project and as 9.0.1 in another?

In my class library, Manage Nuget Packages shows the latest stable version of Newtonsoft as 12.0.3. In another application that references the class library, Manage Nuget Packages shows the latest stable version of Newtonsoft as 9.0.1
What would explain that difference, and how is it fixed in Visual Studio 2019? When I try to compile the application, it fails with the error that the class library's version of Newtonsoft is newer.
EDIT: I think I've found the reason: in the top right corner of the window the package source for the application was not nuget.org but Visual Studio Offline Sources.
Why is the latest stable version of Newtonsoft showing in Nuget
Package Manager as 12.0.3 in one project and as 9.0.1 in another?
When you install a nuget package, you should select the right nuget package source.
As it shows that, Visual Studio Offline Sources is your local nuget caches. It is required that you download the corresponding nuget version and then exist in this data source. So it depends on you and not all versions of the package are fully displayed.
nuget.org is the ultimate destination for developers releasing nuget packages. You can find every version of the package here. So you should check this link.
Check and enable that link.
Then, open Nuget Package Manager UI and choose nuget.org and you can find it.

NuGet Package Dependency Auto Upgrade

I have a private NuGet package that I'm installing on an existing project. The project already contains several of the dependencies the private NuGet package requires but at a lower version than what the private package requires. When I try to install the private package the installation throws an error (no error number)
Package restore failed. Rolling back package changes for
'ConsoleApp1'.
In the package manager output it is reporting a
Detected package downgrade
Since the package that it's referencing is a public package on NuGet.org I would expect at a minimum to be prompted to upgrade the dependency during the installation process instead of erroring and rolling back. I've know packages that are not already included in the project are being installed automatically and can see that in the logs.
I've seen other posting that range from ignoring the warning/error to a pre-build script that does the upgrade (which is not a option for installing new packages)
Can the package manager be instructed to automatically upgrade the existing packages to at least the minimum version the dependency list has defined?
Afraid not.
It's not really a trivial problem to solve - suppose it uses the approach you suggested and your project currently references packageA v1.0.0 and packageB v1.0.0.
You add a new package with a dependency on package A v2.0.0.
It prompts you to upgrade packageAfrom 1.0.0 to 2.0.0 to avoid a downgrade.
But package A 2.0.0 has a new dependency on packageBat 2.0.0, which causes a downgrade for you on that package.
Every new upgrade in turn can trigger new upgrades. You can also engineer scenarios where there isn't even a way to upgrade other packages to make it all work. On top of that all of this requires fetching lots of information from your package source.
Since there's not a clear, general way to fix this the tooling leaves you to work out what you want to do yourself.

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.

NuGet - Newbie issue on large enterprise system

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

Search and Select Specific package version using Nuget Package Manager

How can I search for a specific version of a package using the "Manage Packages" dialog and install in to current project?
I am trying to install "Fluent NHibernate 1.3.0.717", however the search only shows "Fluent NHibernate 1.2.0.712" .
I am aware that I can install specific version using the Package Manager console, but I want to know how can it be done via Manage Packages GUI.
There's currently no way to get a specific version of a package in NuGet Package Manager.
For simplicity the NuGet Pacackage Manager's current behavior is to show the latest versions only. The console offers more control over which versions can be installed.
But, in your case, the dialog should show 1.3.0.717. I filed a bug (#468) against the NuGet Gallery, since 1.2.0.712 is marked as the latest : http://nuget.org/packages/FluentNHibernate/1.3.0.717