0

I am looking for way to get SPProductNumbervia client object model. I have sharepoint app, and I need to connect client application and that app. To do this I need to get SPProductNumber. If there is not way, anyone know how to check it with Sharepoint GUI?

Sebastian 506563
  • 6,980
  • 3
  • 31
  • 56

2 Answers2

2

I know this is an old thread, but I needed the exact same functionality today and didn't found a list what property returns what in which situation.

The ClientContext object has a few properties regarding to versions which are explained by Microsoft in this way:

  • ClientContext.ServerVersion: Gets the version of the current
    SharePoint Server.
  • ClientRuntimeContext.ServerLibraryVersion: Gets the build version of Microsoft.SharePoint.Client.ServerRuntime.dll on the server.
  • ClientRuntimeContext.ServerSchemaVersion: Gets the schema version of Microsoft.SharePoint.Client.ServerRuntime.dll on the server.
  • ClientRuntimeContext.RequestSchemaVersion: Gets of sets the schema version of the request. If this value is not set, the default value is equal to the value of the CurrentVersion property. For example, for a client running Microsoft Office 2013 to communicate with a server running Microsoft Office 2010, the value RequestSchemaVersion must be set to “14.0.0.0”. Otherwise, the server will reject the request.

I did some tests in C# with the CSOM libraries (v16.0.3104.1200 & v15.0.4711.1000) and these are the results when connecting to different SharePoint environments. The subversions can be different depending on which updates are installed on the SharePoint environments.

SharePoint 2010:
ClientContext.ServerVersion: 14.0.4762.1000
ClientContext.ServerLibraryVersion: 14.0.4762.1000
ClientContext.ServerSchemaVersion: 14.0.0.0
ClientContext.RequestSchemaVersion: 14.0.0.0

SharePoint 2013:
ClientContext.ServerVersion: 15.0.4667.1000
ClientContext.ServerLibraryVersion: 15.0.4667.1000
ClientContext.ServerSchemaVersion: 15.0.0.0
ClientContext.RequestSchemaVersion: 15.0.0.0

Office 365:
ClientContext.ServerVersion: 16.0.5701.1202
ClientContext.ServerLibraryVersion: 16.0.5701.1202
ClientContext.ServerSchemaVersion: 15.0.0.0
ClientContext.RequestSchemaVersion: 15.0.0.0

When testing with the CSOM libraries of SP2010 (v14.0.4762.1000) you cannot connect to an Office 365 environment (because it uses the SharePointOnlineCredentials which are not present in these libraries). Also the property RequestSchemaVersion is not known in these libraries. The results when connecting to SP2010 & SP2013:

SharePoint 2010:
ClientContext.ServerVersion: 14.0.4762.1000
ClientContext.ServerLibraryVersion: 14.0.4762.1000
ClientContext.ServerSchemaVersion: 14.0.0.0

SharePoint 2013
ClientContext.ServerVersion: 15.0.4667.1000
ClientContext.ServerLibraryVersion: 15.0.4667.1000
ClientContext.ServerSchemaVersion: 14.0.0.0 // (this one is different from above)
Nathan Swannet
  • 220
  • 3
  • 12
0

You can get it using the following code:

CSOM (e.g. C#)

ClientContext.ServerVersion

JavaScript:

SP.ClientContext.get_current().get_serverVersion()
johnnyRose
  • 7,310
  • 17
  • 40
  • 61
Damon
  • 86
  • 4