From ceaa23b64f5e5a12e9916c075a4f32e0a735dd87 Mon Sep 17 00:00:00 2001 From: Coen van den Munckhof Date: Fri, 24 Jun 2022 13:48:01 +0200 Subject: [PATCH 1/2] fix --- src/RepoM.App/AutoStart.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/RepoM.App/AutoStart.cs b/src/RepoM.App/AutoStart.cs index 4f674eef..6b4327a0 100644 --- a/src/RepoM.App/AutoStart.cs +++ b/src/RepoM.App/AutoStart.cs @@ -42,6 +42,14 @@ private static string GetValueAsString(RegistryKey? key, string appName) private static string GetAppPath() { - return $"\"{Assembly.GetEntryAssembly()!.Location}\""; + var path = Assembly.GetEntryAssembly()!.Location; + + // Dirty hack. We need the exe instead of dll (this has probably something to do with the upgrade to net6) + if (path.EndsWith(".dll", StringComparison.CurrentCultureIgnoreCase)) + { + path = path[..^4] + ".exe"; + } + + return $"\"{path}\""; } } \ No newline at end of file From 6aaa4499592df9125995952375fd3ed6fc17de56 Mon Sep 17 00:00:00 2001 From: Coen van den Munckhof Date: Fri, 24 Jun 2022 13:51:58 +0200 Subject: [PATCH 2/2] public - internal --- src/RepoM.App/AutoStart.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/RepoM.App/AutoStart.cs b/src/RepoM.App/AutoStart.cs index 6b4327a0..c6f23e68 100644 --- a/src/RepoM.App/AutoStart.cs +++ b/src/RepoM.App/AutoStart.cs @@ -4,7 +4,7 @@ namespace RepoM.App; using System.Reflection; using Microsoft.Win32; -public static class AutoStart +internal static class AutoStart { private const string REG_KEY = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Run";