Class AppVersionInfo
Provides version information about the application, usually parsed from AssemblyInformationalVersionAttribute.
public sealed record AppVersionInfo : IEquatable<AppVersionInfo>
- Inheritance
-
AppVersionInfo
- Implements
- Inherited Members
- Extension Methods
Constructors
AppVersionInfo(string, string?, string?)
Provides version information about the application, usually parsed from AssemblyInformationalVersionAttribute.
public AppVersionInfo(string Version, string? PreviewIndicator, string? CommitSha)
Parameters
VersionstringThe main part of the informational version. Assuming a version like '1.2.3-preview', the main version is the '1.2.3' part.
PreviewIndicatorstringThe optional preview indicator that follows the version string. Assuming a version like '1.2.3-preview', the preview indicator is the 'preview' part.
CommitShastringThe SHA of the commit that built the application, if available.
Properties
CommitSha
The SHA of the commit that built the application, if available.
public string? CommitSha { get; init; }
Property Value
PreviewIndicator
The optional preview indicator that follows the version string. Assuming a version like '1.2.3-preview', the preview indicator is the 'preview' part.
public string? PreviewIndicator { get; init; }
Property Value
Version
The main part of the informational version. Assuming a version like '1.2.3-preview', the main version is the '1.2.3' part.
public string Version { get; init; }
Property Value
Methods
InformationalVersionForAssembly(Assembly)
public static AppVersionInfo? InformationalVersionForAssembly(Assembly assembly)
Parameters
assemblyAssembly
Returns
Parse(AssemblyInformationalVersionAttribute)
public static AppVersionInfo Parse(AssemblyInformationalVersionAttribute attribute)
Parameters
attributeAssemblyInformationalVersionAttribute
Returns
Parse(string)
public static AppVersionInfo Parse(string versionString)
Parameters
versionStringstring