Add Sitecore references through NuGet

Normally all the developers are giving a reference of all the required dlls from NuGet. But for Sitecore dlls, we normally add a folder as “Lib” and add all the Sitecore dlls in it and then add reference of required dlls from this folder.

This was ok but sometimes when a developer by mistake add reference of any Sitecore dll from local machine which has different version then the expected, it will create a big issue.

Solution!! We can add Sitecore related assemblies references through NuGet.

Yesssss!!!!  Sounds good. So how can i configure it?, here is the answer:

For NuGet feed, its different for Visual Studio versions.

  • For VS 2015+ : https://sitecore.myget.org/F/sc-packages/api/v3/index.json
  • For VS 2012+ : https://sitecore.myget.org/F/sc-packages/
  • Browse Package : https://sitecore.myget.org/gallery/sc-packages

Follow the steps to configure this feed to your Visual Studio.

Step 1: Click on “Tools” -> “Options” menu, Click on “NuGet Package Manager” -> “Package Source”.1

Step 2: Add new Package Source by clicking “+” Image and add Name as “Sitecore” and Source as “https://sitecore.myget.org/F/sc-packages/api/v3/index.json”. (This feed is of VS 2015+) and Click on “UPDATE” Button and Click on “OK” Button. 2

Step 3: Now click on “Manage NuGet Package” will show option of Sitecore regarding available dlls, Select dlls as per your requirement. 3

Benefits:

  • No need to add Sitecore references into the repository
  • Reduce mistakes about adding different Sitecore references.
  • Easy to mange.
  • Many Packages for Sitecore Module are also available with NuGet like WFFM, Dynamic CRM, Data Exchange, Email Experience Manger etc…..

Note: Support dlls are still not available on NuGet.

for the rest, refer the FAQs of Sitecore public NuGet Package form here.

Enjoy Sitecore with NuGet !!!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a website or blog at WordPress.com

Up ↑

%d bloggers like this: