From 1b95ec253ba5b2716c2a6ec726ca1be40837ecc0 Mon Sep 17 00:00:00 2001 From: Chris Kaczor Date: Fri, 28 Apr 2023 07:53:38 -0400 Subject: [PATCH] Fix auto-start path with DLL name --- ApplicationExtensions.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ApplicationExtensions.cs b/ApplicationExtensions.cs index 6f92b63..a14dfcb 100644 --- a/ApplicationExtensions.cs +++ b/ApplicationExtensions.cs @@ -1,6 +1,6 @@ -using System; +using Microsoft.Win32; +using System; using System.Reflection; -using Microsoft.Win32; namespace ChrisKaczor.Wpf.Application { @@ -15,7 +15,7 @@ namespace ChrisKaczor.Wpf.Application public static void SetStartWithWindows(this System.Windows.Application application, string applicationName, bool value) { - var applicationPath = $"\"{Assembly.GetEntryAssembly()!.Location}\""; + var applicationPath = $"\"{Environment.ProcessPath}\""; SetStartWithWindows(application, applicationName, applicationPath, value); }