Updated with new information about NuGet feeds for 9.1
Previously, the 9.1 packages were in a separate feed, as of March 4th 2019, these have now been moved back into the main feed. The NoReferences packages are still removed.
To avoid link rot, here are the feed urls for the official feeds:
For all versions:
NuGet V3 feed URL (Visual Studio 2015+)
NuGet V2 feed URL (Visual Studio 2012+)
Browse packages
Versioning Updates
As of 9.1, The package versions will follow the Product version numbers, this will make it easier to identify which version a package refers to rather than having to look up the revision number for each update. So Sitecore 9.1 packages are versioned 9.1.0
This is a breaking change!!!
In the separate 9.1 feed, the version numbers followed the binary versions, so the version for 9.1 initial release was 12.0.0
, in the new feed they follow the product version, so it will now be 9.1.0
, so when you switch to the correct feed, you will have to change your version numbers to match.
What about the separate 9.1 feed? Will this break my build?
TL/DR; No, it wont, but you should change the feed asap.
Sitecore are removing the "old 9.1" feed listing from the gallery, but the feed will remain in place for those of you who have already used it. Once you upgrade, you will need to use the original feed for newer packages.
What happened to the .NoReferences
packages?
With the new updates to the packages, Sitecore have also stopped providing the .NoReferences
packages. This was done to simplify the the process for developers and also the release process for Sitecore.
But - you can still have a similar behavior with the full packages. Using the Nuget Package Manager you can change the Dependency Behavior
option to Ignore Dependencies
:
If you want to use the Package Manager Console you can use the -IgnoreDependencies
flag like this:
Install-Package -Id <package name> -IgnoreDependencies -ProjectName <project name>
PackageReference
For those of you on VS 2017+, you can also migrate to using PackageReference
to reference your nuget packages. This uses the PackageReference
node in the .csproj
file to manage the NuGet dependencies instead of the packages.config
file. This brings a number of benefits that are too numerous to mention here, but you can find out more on the PackageReference page.
Build Servers
If you are using a build server, as well as adding this to Visual Studio you will want to update your Nuget.config
file:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!--
Used to specify the default Sources for list, install and update.
-->
<packageSources>
<add key="Official Sitecore" value="<URL to the package feed appropriate for your project>" />
</packageSources>
<activePackageSource>
<!-- this tells that all of them are active -->
<add key="All" value="(Aggregate source)" />
</activePackageSource>
</configuration>
Upgrading your Solution
There is a nice post here talking about adding that to your VS solution: https://jermdavis.wordpress.com/2016/09/05/the-official-sitecore-nuget-feed-is-here/
Some of the main points when using are:
- There are packages with
.NoReferences
suffixed. These are probably the most useful as they don't try to bring in a lot of dependencies you may not need in your project. - They set the binaries as
CopyLocal=true
, so you may want to change that in your project
@kamsar wrote a nifty PowerShell script to update your solution to use this: http://kamsar.net/index.php/2016/09/Nugetify-your-Sitecore-References/