February 2nd, 2021

General Availability of the new PnP Framework library for automating SharePoint Online operations

PnP Framework recently got released as GA version, which is an important milestone in the upgrade of the PnP .NET components. PnP Framework replaces the PnP Sites Core library which has been around for a long time and used a lot by the community (70.000+ tenants are using this each month, thanks for that!). In short, PnP Framework is a library that extends SharePoint CSOM API surface with a ton of extension methods, a provisioning engine, a modern pages API and more. The used CSOM version is Microsoft CSOM for .NET Standard 2.0, which results in PnP Framework being a cross platform library that works with the classic .NET framework, .NET Core and .NET 5. Next to CSOM, PnP Framework also uses the Microsoft Graph API and SharePoint REST API to implement functionality not offered via CSOM.

Why did you build PnP Framework?

Overtime the classic PnP Sites Core has grown into a hard to maintain code base which made us decide to start a major upgrade effort for all PnP .NET components. As a result of that, PnP Framework is a slimmed down version of PnP Sites Core dropping legacy pieces and dropping support for on-premises SharePoint in favor of improved quality and maintainability. If you’re still using PnP Sites Core with your on-premises SharePoint than that’s perfectly fine, we’re not going to pull these components but you’ll not see any updated versions going forward. PnP Framework is a first milestone in the upgrade of the PnP .NET components, in parallel we’re building a brand new PnP Core SDK using modern .NET development techniques focused on performance and quality (check our test coverage and documentation). Overtime we’ll implement more and more of the PnP Framework functionality in PnP Core SDK and then replace the internal implementation in PnP Framework. The modern pages API is good example: when you use that API in PnP Framework you’re actually using the implementation done in PnP Core SDK. Below picture gives an overview of our journey and the road ahead:

PnP .NET roadmap

How does this relate to Microsoft Graph?

Lot of SharePoint APIs are available also via Microsoft Graph and if everything you need is there, using Microsoft Graph SDKs is the recommended approach. If you need APIs which not available via Microsoft Graph or you need specific capabilities (e.g. modern pages API, provisioning engine) then PnP Framework is the way to go. We are constantly doing investments on improving the Microsoft Graph coverage also in SharePoint side, so check the Microsoft Graph changelog for all the updates.

What’s the supportability story on the PnP PowerShell module?

PnP Framework uses publicly available and supported APIs from Microsoft 365. PnP Framework is open-source, community driven initiative, supported by the community for the community.

 

Should I switch PnP Sites Core to PnP Framework?

With PnP Framework available as GA version it’s recommended that you switch your existing application from PnP Sites Core to PnP Framework as there will be no new PnP Sites Core versions. Overall this should be a quite seamless transition, the main difference is how you’d setup authentication as PnP Framework relies on an Azure AD app for authentication. We’ve written a short migration guide that helps you with the needed steps, if you’re stuck somehow please raise an issue or discussion in our GitHub PnP Framework repository.

Tip: Both PnP Framework and PnP Core SDK have Source Link support making it super easy for you to step inside the code and see how things work. Checkout our debugging guide to learn more.

How can I contribute?

All the PnP .NET components are open source built by Microsoft together with our MVPs and community members. We’d love to get your contributions! Contributing can be done via providing feedback, creating an issue, creating a pull request with a fix, documentation changes, blogging,… Together we can make the PnP .NET components better!

“Sharing is caring!”


Microsoft 365 Patterns and Practice (PnP) – 28th of January

Author

We coordinate the Microsoft 365 Patterns and Practices (PnP) open-source and community activities.