Add AssemblyName extension property to PE

This commit is contained in:
Matt Nadareski
2025-09-08 07:56:40 -04:00
parent af6dd6a7fc
commit 94c1a86702

View File

@@ -596,6 +596,25 @@ namespace SabreTools.Serialization.Wrappers
}
}
/// <summary>
/// Name as derived from the assembly manifest
/// </summary>
/// <remarks>
/// If there are multiple identities included in the manifest,
/// this will only retrieve the value from the first that doesn't
/// have a null or empty name.
/// </remarks>
public string? AssemblyName
{
get
{
var manifest = GetAssemblyManifest();
var identities = manifest?.AssemblyIdentities ?? [];
var nameIdentity = Array.Find(identities, ai => !string.IsNullOrEmpty(ai?.Name));
return nameIdentity?.Name;
}
}
/// <summary>
/// Version as derived from the assembly manifest
/// </summary>