Escolar Documentos
Profissional Documentos
Cultura Documentos
Increase developers productivity by encapsulating complex operations into simple method calls
Provide centralized community driven component, which evolves based on real-life requirements
Provide clear and well-known release cycles for the component
Provide consistency with customizations implemented on top of SharePoint, so that SharePoint
engineering knows how field is customizing SharePoint
The PnP initiative which controls the PnP .NET component versioning and releases is owned by SharePoint
engineering, but the roadmap of the component is controlled by the PnP Core team which consists of
community members and Microsoft employees. This ensures that the development and directions of the
component are based on real world customers cases and are aligned with the SharePoint roadmap.
SharePoint engineering is also using PnP .NET component as a source and inspiration for the needed native capabilities in the SharePoint product.
There are numerous different capabilities provided by the PnP .NET Core component. Heres the main
areas that are included:
There are three different versions of the PnP .NET Core Component, targeted for specific SharePoint versions. This is required due the CSOM API differences cross these versions. Supported versions are SharePoint 2013, SharePoint 2016 and SharePoint Online.
The PnP .NET Core component is also used by PnP PowerShell, which enables IT Pros and non-developers
to take advantage of the Core component implementation. PnP PowerShell exposes Core component operations as PowerShell CmdLets, which can be then used in PowerShell scripts to automate operations
with SharePoint.
Key metrics and statistics on the PnP .NET Core Component project
Following table shows the key metrics and statistics of the PnP .NET Core Component work.
Metric
GitHub Forks
Visitors during past 2 weeks (7th of Sep)
Closed pull requests
Closed issues / enhancements
Contributors
Commits
#
262
1151
473
113
45
1695
PnP .NET Core component usage is tracked by Microsoft using HTTP headers included with the CSOM
operations performed by the component. This enables the PnP initiative to collect additional details on
the component usage cross SharePoint
Online. This tracking was enabled on April
2016 release and adoption is visible when
customizations are upgrading to newer versions of the package.
Following chart shows the growth of the
component usage in SharePoint Online production tenants between April 2016 and August 2016.
Moreover, the PnP Core component is just
one of the open source repositories provided by the PnP community initiative, which at the time of writing covers about 10 public and open source
repositories and overall counts more than 2.000 forks, and hundreds of contributors.
Overall, the PnP Core component NuGet packages have been downloaded by more than 45.000 developers.
Extension methods
The extension methods cover the whole breadth of CSOM, but eases the life of a developer by combining
several tasks into single lines of code.
Take for example the CSOM code required to create a Content Type:
using (var context = new ClientContext("http://myserver")) {
Web web = context.Web;
var contentTypeCI = new ContentTypeCreationInformation();
contentTypeCI.Name = "Test";
contentTypeCI.Description = "Test description";
contentTypeCI.Group = "Test group";
contentTypeCI.Id = ctID;
var ct = web.ContentTypes.Add(contentTypeCI);
context.Load(ct);
context.ExecuteQuery();
}
This list of commands basically never changes when creating a content type, with the exception of the
values one is using.
Using PnP Core a developer can simplify this to:
using (var context = new ClientContext("http://myserver")) {
Web web = context.Web;
var ct = web.CreateContentType("Test", "Test description", ctID, "Test group");
}
The result is more concise code, easier to read and easier to maintain. We employ best practices in our
extension methods, checking for situations that normally would require additional code (like duplicate
names, checking for the existence of an artifact before removing it, etc.).
A major benefit of over using the Core Component is the availability of the ExecuteQueryRetry() method,
which can replace the context.ExecuteQuery() statement. Calls to Office 365 can be throttled, due to
server load for instance. The Core Component ExecuteQueryRetry() method, as the name implies, will
automatically retry, up to a certain number of retries, to execute the query, greatly easing the handling
of throttling in the case of client side code.
The overall goal of the PnP Core Provisioning Engine is to make it simple what is really useful and common
when provisioning sites and artifacts. The provisioning template can be created in memory, using a domain model that is defined within the PnP Core component, or it can be persisted as a file. In the latter
scenario, out of the box the file can be an XML file, based on a community defined XML Schema
(https://github.com/OfficeDev/PnP-Provisioning-Schema), it can be a JSON file, or it can be an Open XML
self-consistent file. By default, a template can be read from or written to a file system folder, a document
library in SharePoint, or a container in the Azure Blob Storage. However, from an architectural perspective
you can implement your own template formatter and your custom persistence provider, in order to save
or load a template with whatever format and persistence storage you like.
Templates can be created either using .NET code, or using the PowerShell extensions that we already
mentioned. Thus, the provisioning engine becomes really useful also for Application Lifecycle Management tasks, because you can design and test your solutions in a development environment, than you can
move the templates across environments like staging and production, simply by using a bunch of PowerShell commands.
Moreover, the provisioning engine supports delta handling of templates, so that developers can keep their
SharePoint sites updated during projects lifetime and synchronized, from an artifacts and configuration
perspective, across different environments (like development, testing, staging, production). This last capability makes the PnP Core component a fundamental tool for Application Lifecycle Management of
SharePoint projects.