Microsoft has introduced a new Client side APIs from SharePoint 2010 and it opens a much easier way to interact with SharePoint object than existing web services. The continuous improvement in client side development and the introduction of App model (now, App is renamed as Add-In) takes the SharePoint 2013 to another level. Then onwards Microsoft is also boosting the developers to move on to client side development.
In parallel, SharePoint online is also boosted due to the availability of new client side APIs and App / Add-In architecture. During that time, the need arises on transforming the SharePoint full trust code solutions to Add-In model for the office 365 environment. The Patterns and Practices team formed and they were involved in that transforming process by creating PnP component APIs and also with guidance.
The PnP components are developed as an open source extension as a part of Office 365 Developer Pattern and Practices deliverables. This component is built on top of SharePoint CSOM and Rest API managed codes. By having the references in our solution, that increases our efficiency in developing the client side add-in or applications.
The source code, sample solutions, guidance documentation, case studies are hosted in GitHub and it is open to all for any type of contributions. By the helpful community contributions, the components are gradually increased by merging more methods and operations to its API. This package is released every month as a part of PnP deliverables.
The assemblies from PnP Core Component will be updated periodically based on community contributions and new versions will be released as part of PnP releases.
The latest and previous versions of assemblies are available as a Nuget package to use in our Visual Studio solutions.
Key Features:
- Simplify remote development for any managed code from any provider hosted add-in or windows code.
- Console application or azure web jobs take advantage of CSOM by connecting SharePoint online and On-premise to modify the sites or provision the sites.
- Relatively fast compared to normal way.
- Reduced in number of code lines to achieve a particular task.
PnP core component provides reusable methods and guidance patterns that help us to integrate better solution to the SharePoint online / on-premise environment by having the below capabilities.
Extension Methods
Extension methods enable you to “add” methods to existing types without creating a new derived type, recompiling, or otherwise modifying the original type. Extension methods are a special kind of static method, but they are called as if they were instance methods on the extended type. For client code written in C# and Visual Basic, there is no apparent difference between calling an extension method and the methods that are actually defined in a type. – MSDN
PnP core component uses this feature and extends the numerous amount of methods to simplify and increase productivity by obstructing the complex coding blocks from native CSOM.
Extension methods from PnP core component are built on top of native CSOM and that help us to access the SharePoint object using one line of code by replacing large code blocks.
Comparison
- //Code to add a new list to web using native CSOM
- Web web = context.Web;
- ListCreationInformation listInfo = new ListCreationInformation();
- listInfo.Title = “WithoutPnP”;
- listInfo.TemplateType = (int)ListTemplateType.GenericList;
- List list1 = web.Lists.Add(listInfo);
- list1.Update();
- context.ExecuteQuery();
- //Code to add a new list to web using PnP extension method
- var list2 = context.Web.CreateList(ListTemplateType.GenericList, "WithPnP", false);
Timer jobs are synchronous jobs to run long operations and it should be deployed as Full trust code solutions in SharePoint and this supports only in on premise environment. There is no support for custom SharePoint timer jobs in SharePoint online or from client side environment.
To run the long operation job remotely and overcome the disadvantage of on premise timer job feature in online environment, PnP core components bring this Remote Timer Job capability to manipulate the SharePoint sites and its object remotely on SharePoint online and on-premise environment.
This framework also helps to authenticate the SharePoint sites remotely. The remote time jobs can run on azure environment or from windows services. No need of Farm solutions based timer jobs. No need of running the timer job on every site collection.
Comparison

There area different number of versions in SharePoint and each of them may be configured to different authentication methods. To authenticate each environment from different application requires different type of codes with different reference to namespaces / classes.
Comparison



Munesh SharmaPosted May 22, 2016, 11:57 AM
good one
Humayun Kabir MamunPosted May 22, 2016, 7:56 AM
Nice...
Kuppurasu NagarajPosted May 17, 2016, 11:06 AM
Nice sharing..
Shantha Kumar TPosted May 17, 2016, 4:13 AM
Thanks to all
Ketak BhalsingPosted May 17, 2016, 1:59 AM
Good info....
Sonu ChaudharyPosted May 16, 2016, 3:30 PM
good
Vipin TyagiPosted May 16, 2016, 5:37 AM
It is an informative article Shantha Kumar T