Monday, April 18, 2016

SharePoint CSOMs for Customizations

One of the biggest questions that you may encounter if you are using the Managed Client Side Object Model for SharePoint development these days is picking up the correct version of the dll. Here is one of the screenshots captured through my dev environment.

As you can see in the above image, there are two versions of dlls available for each dll under different version numbers. 

Numbers suggest it...

As we all know, SharePoint 2010 was frequently known with the version 14 and SharePoint 2013 is with version 15. Same are applied here as well. 

According to a blog post by Vesa at the Office Dev Center blog available here

  • CSOM version 15 is for SharePoint 2013
  • CSOM version 16 is for SharePoint 2016
  • CSOM version 16.1 is for SharePoint Online

Therefore when you are making a development against a specific platform, it is best and recommended to pick the correct version.

I was mistaken...

I was mistaken as you can see on the screenshot and used the Version 16 for a client app that works on both SharePoint 2013 and SharePoint Online. However, I have safely got through as the functions I use are basic and they do have the basic operations associated with list items and the web properties. 

Also it is mentioned in the blog why it works,
It works fine unless you will use properties or methods which are not exposed in the on-premises. If you can guarantee that your code does not touch properties which have not been enabled in on-premises version, you can theoretically use SharePoint Online CSOM with on-premises as well. We do however recommend on using right CSOM version for specific server side version to avoid issues. 

How to get?

Microsoft Download Center has all the client component SDKs related to each version of SharePoint.

No comments:

Post a Comment