I'm maintaining a CSOM CLI solution for interacting with SharePoint 2013 (automated creation of lists and libraries, manage groups, ...). The solution is built with the SharePoint Server 2013 Client Components SDK.
The solution should now be extended for SharePoint Online. The same codebase should work against both 2013 On Premise and Online.
As far as I understand, the SharePoint Online CSOM SDK is some sort of superset of the On Premise CSOM SDKs. From what I've read in this article from Vesa Juvonen at the Office Dev Center from 2016 I could use the Online CSOM SDK for interacting with On Premise as long as I make sure I'm just using the properties and methods that are already exposed for 2013:
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.
So my first idea now is to exchange the 2013 CSOM SDK within my solution with the SharePointPnPCoreOnline NuGet package.
However the Vesu Juvonen also says:
We do however recommend on using right CSOM version for specific server side version to avoid issues.
But I would like to avoid building and shipping two versions of my solution (On Premise and SPO).
My question is, if anybody has encountered problems when using the SharePointPnPCoreOnline SDK against SharePoint 2013 On Premise. Or maybe there is a more elegant solution for building a solution that is capable of working with 2013 and SPO nowadays?