Operations: Server: How to Get Server Build Number
To get the server build number use GetBuildNumberOperation from Maintenance.Server
Syntax
public GetBuildNumberOperation()
Return Value
The result of executing GetBuildNumberOperation is a BuildNumber object:
public class BuildNumber
{
public string ProductVersion { get; set; }
public int BuildVersion { get; set; }
public string CommitHash { get; set; }
public string FullVersion { get; set; }
}
ProductVersion | current product version e.g. "4.0" |
BuildVersion | current build version e.g. 40 |
CommitHash | git commit SHA e.g. ""a377982"" |
FullVersion | semantic versioning e.g. "4.0.0" |
Example
var getBuildNumberResult = documentStore.Maintenance.Server.Send(new GetBuildNumberOperation());
Console.WriteLine(getBuildNumberResult.BuildVersion);
var buildNumber = await documentStore.Maintenance.Server.SendAsync(new GetBuildNumberOperation());
Console.WriteLine(buildNumber.BuildVersion);