OptrisOptrisDocumentation

Documentation/OTC SDK/Optris.Sdk — C# API referencev12.0

SdkBuildInfo

public sealed record SdkBuildInfo : IEquatable<SdkBuildInfo>

Which build of the SDK is loaded -- commit, branch, build date and platform, not just the release number.

Sdk.Version answers "which release"; this answers "which build of it". They are different questions, and it is the second one that identifies a binary when a fault has to be traced back to the code that produced it. Put it on an About page and in any diagnostics bundle you upload.

No string property here is ever empty. A value the build could not determine reads exactly "unknown". That is the contract, and it is deliberate: an empty string is indistinguishable from a field nobody filled in, and a stale or invented commit is worse than no commit at all, because it sends support to code that is not in the binary.

The two dates are the exception, and are null rather than "unknown" when they are absent, because DateTimeOffset has no spelling for "not recorded". See SdkBuildInfo.BuildDate.

Example

SdkBuildInfo build = Sdk.BuildInfo;
Console.WriteLine(build);
// Optris SDK 12.0.1 (Release) commit 3f9c4ad21 on release/v12.x,
// built 2026-10-14T08:02:16.0000000+00:00 for Linux amd64

SdkBuildInfo: properties

public string Branch { get; }

The branch the native library was built from, or "unknown".

A release is built from a detached checkout of one revision, so this is the branch the build system said it was building rather than anything the checkout itself remembers. It is never the literal string "HEAD".

public Nullable<DateTimeOffset> BuildDate { get; }

When the native library was compiled, or null if the build did not record it.

Always UTC. The underlying value is generated by CMake with an explicit +0000 offset rather than in local time, so the offset carried here is real and not an assumption this binding made up.

Nullable on purpose. A DateTimeOffset cannot say "not recorded", and every other property in this type answers that case with "unknown"; silently substituting DateTimeOffset.MinValue would put a date on a diagnostics upload that no build ever had.

public string BuildType { get; }

The CMake build type, e.g. "Release" or "Debug".

public Nullable<DateTimeOffset> CommitDate { get; }

When the commit named by SdkBuildInfo.CommitHash was made, or null if the build did not record it.

Carries the committer's own zone offset, which is what git records, so this is not normalised to UTC. Compare instants, not wall-clock text.

public string CommitHash { get; }

The abbreviated hash of the commit the native library was built from, or "unknown".

This is the field a support request is really after. Quote it verbatim.

A build made from a modified working tree has -dirty appended -- "3f9c4ad21-dirty" -- which means the named commit does not describe what was compiled. Released packages are built from clean checkouts and never carry it.

public string Os { get; }

The operating system the native library was built for, e.g. "Linux" or "Windows".

What the library was built for, not what it is running on. Use RuntimeInformation for the latter; a mismatch between the two is itself worth reporting.

public string Platform { get; }

The architecture the native library was built for, e.g. "amd64" or "arm64".

public string Version { get; }

The product version as the SDK displays it, e.g. "12.0.0".

The same value as Sdk.VersionString. Both read one constant compiled into the native library, so they cannot disagree; it is repeated here so that one property bag holds everything a support ticket needs.