I know name of nuget package in official nuget gallery. How can I check on which platforms it's avaibale, e.g full .net, silverlight, windows store apps, universal platform, etc..?
On Windows I normally use the NuGet Package Explorer which will download the NuGet package and show you its contents. The frameworks it supports are shown in the lib directory inside the NuGet package.
You can also just download the NuGet package from NuGet and unzip it.
Related
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.
I have written a little library for Sitecore(a CMS product) which means my library depends on Sitecore. Sitecore, the company, have recently made their product available as nuget packages. However they have chosen to host their own nuget package source.
When I use nuget spec/pack myLibrary.csproj to generate a nuget package, only the nuget packages from the official package source are included as dependencies.
Is it possible to include dependencies from another package source in nuget packages?
Or maybe I should ask, how do you go about creating packages from alternative package sources ?
In my solution I have a PCL project and two other projects, each for different platforms.
Sometimes a NuGet package used in PCL require installing it to the platform project as well, otherwise things will crash at runtime.
When I install the NuGet package, how do if it's also required to install it to the platform projects?
For example, it's not clear to me if Microsoft.Net.Http requires also installation in Xamarin Android project or not. This is just an example.
Or, I don't know if SQLite.Net-PCL requires it to be installed on platform projects as well.
Things you can do:
Read the documentation provided by the NuGet package author. Either from a project web site or in the description for the NuGet package.
Use your favourite search engine for examples of how to use that NuGet package.
If there are multiple NuGet packages that are named after the platform then that gives you an idea that the PCL NuGet package might not work in the platform specific project.
Have a look inside the NuGet package using something like the NuGet Package Explorer available on Windows. If the NuGet package has lib directories that are platform specific as well as a PCL directory then it will need to be installed in the platform specific project.
Run your application and see if it works.
Taking Microsoft.Net.Http as an example. The documentation does not really say explicitly. If you search the internet you can find a blog post or two that mentions that you have to install it into your platform specific project.
If you take a look inside the Microsoft.Net.Http NuGet package you can see it has several lib directories:
There are platform specific directories, such as MonoAndroid and Xamarin.iOS10 as well as PCL directories, such as portable-net45+win8. This suggests you should install it into all your projects.
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.
For the life of me I can't find an option to install all nuget packages to a central folder.
The only option seems to be Install and that always installs into the project folder.
With multiple projects using the same packages this is very inefficient.
I'd like to install all packages to the same central folder.
Can this be done?
Answer is here: Is it possible to change the location of packages for NuGet?
I successfully tried it with VS2012 and the latest nuget manager.