SP16 - Use PnP Library to access SP On-Premise Data
-
29-12-2020 - |
Question
Can i use any pnp library(.ddl) to access SharePoint 2016 On-Premise data in Visual Web Part Solution?
I want to Use SharePoint Server Object Model
La solution
PnP Sites core
provides you with extensions over the CSOM/REST operations.
PnP JS core
library provides you with a wrapper over the existing SharePoint REST APIs along with some utility and helper functions.
You have mentioned that you will be using a Visual webpart.
So, technically, yes, you can use the PnP core dll in your visual webpart. But its primarily targeted for Provider hosted apps. So, it makes no sense to use PnP or CSOM dll as you have entire Server object model(Microsoft.SharePoint.dll
) at your disposal.
Also, if you are thinking of performing RESTful operations from your Visual webpart, you can use the PnP JS library. It can be used across, 2013,2016 and Online with almost no major hiccups in operations.
References - PnP Sites core overview