diff --git a/LANCommander.SDK/Migrations/MigrationHistory.cs b/LANCommander.SDK/Migrations/MigrationHistory.cs index b783d0d7..e7f2614b 100644 --- a/LANCommander.SDK/Migrations/MigrationHistory.cs +++ b/LANCommander.SDK/Migrations/MigrationHistory.cs @@ -92,6 +92,11 @@ public class MigrationHistoryEntry /// public string? ApplicationVersion { get; set; } + /// + /// The name of the application that ran this migration. + /// + public string? Application { get; set; } + /// /// The machine name where the migration was executed. /// diff --git a/LANCommander.SDK/Services/MigrationHistoryService.cs b/LANCommander.SDK/Services/MigrationHistoryService.cs index 1169daf7..ba1be1f3 100644 --- a/LANCommander.SDK/Services/MigrationHistoryService.cs +++ b/LANCommander.SDK/Services/MigrationHistoryService.cs @@ -124,6 +124,7 @@ public class MigrationHistoryService(ILogger logger) ErrorMessage = exception?.Message, StackTrace = exception?.StackTrace, ApplicationVersion = GetApplicationVersion(), + Application = GetApplicationName(), MachineName = Environment.MachineName }; @@ -172,4 +173,17 @@ public class MigrationHistoryService(ILogger logger) return null; } } + + private static string? GetApplicationName() + { + try + { + var assembly = Assembly.GetEntryAssembly() ?? Assembly.GetExecutingAssembly(); + return assembly.GetName().Name; + } + catch + { + return null; + } + } }