Compare commits

...

3 Commits

Author SHA1 Message Date
Leilei Zhang
6f829144be Merge branch 'main' of https://github.com/microsoft/PowerToys into leilzh/loggeraot 2025-07-01 10:53:59 +08:00
Leilei Zhang
140d264eed remove unused 2025-06-20 14:55:18 +08:00
Leilei Zhang
c56689cdc0 make logger aot compatiable 2025-06-20 14:32:40 +08:00

View File

@@ -22,16 +22,7 @@ namespace ManagedCommon
private static readonly string Debug = "Debug";
private static readonly string TraceFlag = "Trace";
private static readonly Assembly Assembly = Assembly.GetExecutingAssembly();
/*
* Please pay more attention!
* If you want to publish it with Native AOT enabled (or publish as a single file).
* You need to find another way to remove Assembly.Location usage.
*/
#pragma warning disable IL3000 // Avoid accessing Assembly file path when publishing as a single file
private static readonly string Version = FileVersionInfo.GetVersionInfo(Assembly.Location).ProductVersion;
#pragma warning restore IL3000 // Avoid accessing Assembly file path when publishing as a single file
private static readonly string Version = Assembly.GetExecutingAssembly().GetCustomAttribute<AssemblyFileVersionAttribute>()?.Version ?? "Unknown";
/// <summary>
/// Initializes the logger and sets the path for logging.