AssemblyUtilities Class

public static class AssemblyUtilities

No documentation is available.

Methods

NameDescription
GetInformationalVersion(Assembly)Gets the informational version of an assembly.
GetLinkerTimestampUtc(Assembly)Gets the linker timestamp of a specified assembly.
GetLinkerTimestampUtc(string)Gets the linker timestamp of a specified assembly.
GetRequiredManifestResourceStream(Assembly, string)Gets a manifest resource stream, throwing an exception if not found.
GetRequiredManifestResourceStream(Assembly, Type, string)Gets a manifest resource stream scoped to the specified type's namespace, throwing an exception if not found.

GetInformationalVersion(Assembly)

AssemblyUtilities.cs

Gets the informational version of an assembly.

public static string? GetInformationalVersion(this Assembly assembly)

Parameters

assembly Assembly
The assembly. May not be null.

Returns

string? The version represented as a string. May not be null.

GetLinkerTimestampUtc overloads

GetLinkerTimestampUtc(Assembly)

AssemblyUtilities.cs

Gets the linker timestamp of a specified assembly.

public static DateTime? GetLinkerTimestampUtc(this Assembly assembly)
Parameters
assembly Assembly
The assembly. May not be null.
Returns

DateTime? A valid date time or null if an error occurred.

GetLinkerTimestampUtc(string)

AssemblyUtilities.cs

Gets the linker timestamp of a specified assembly.

public static DateTime? GetLinkerTimestampUtc(string filePath)
Parameters
filePath string
The assembly file path.
Returns

DateTime? A valid date time, or null if the file has no meaningful timestamp or could not be read.

Remarks

Deterministic builds, which the .NET SDK produces by default, store a hash of the content in the COFF TimeDateStamp field instead of a date. Those are reported as null rather than as the arbitrary date the hash decodes to.

GetRequiredManifestResourceStream overloads

GetRequiredManifestResourceStream(Assembly, string)

AssemblyUtilities.cs

Gets a manifest resource stream, throwing an exception if not found.

public static Stream GetRequiredManifestResourceStream(this Assembly assembly, string name)
Parameters
assembly Assembly
name string
Returns

Stream

GetRequiredManifestResourceStream(Assembly, Type, string)

AssemblyUtilities.cs

Gets a manifest resource stream scoped to the specified type's namespace, throwing an exception if not found.

public static Stream GetRequiredManifestResourceStream(this Assembly assembly, Type type, string name)
Parameters
assembly Assembly
type Type
name string
Returns

Stream