Admin::ReadServerVersion method
Office 2013 and later
Reads the Project Server version major, minor, build, and revision numbers.
Namespace: WebSvcAdmin
Assembly: ProjectServerServices (in ProjectServerServices.dll)
Return value
Type: System.Data.DataSetThe DataSet contains a single table named ServerVersion and one row with the column names WADMIN_VERSION_MAJOR, WADMIN_VERSION_MINOR, WADMIN_VERSION_BUILD, and WADMIN_VERSION_REVISION.
The ProjectServerVersion sample method returns a string that combines all four fields in the table.
using System; using System.Data; . . . public string ProjectServerVersion(SvcAdmin.Admin admin) { string major, minor, build, revision; string version = ""; DataSet dsInfo = admin.ReadServerVersion(); DataRow row = dsInfo.Tables["ServerVersion"].Rows[0]; major = row["WADMIN_VERSION_MAJOR"].ToString(); minor = row["WADMIN_VERSION_MINOR"].ToString(); build = row["WADMIN_VERSION_BUILD"].ToString(); revision = row["WADMIN_VERSION_REVISION"].ToString(); build = build.Insert(build.Length - 4, "."); version = major + "." + minor + "." + build + ", rev. " + revision; return version; }
In the example, the PSI Admin Web service namespace is AdminWebSvc. The admin parameter is a class variable that is defined in the calling class, as follows:
public static AdminWebSvc.Admin admin = new WebSvcAdmin.Admin(); . . . string ver = ProjectServerVersion(admin);
For example, ProjectServerVersion returns the following string for the released version of Microsoft Project Server 2010: 14.0.4750.1000, rev. 15
Show: