From eaf006d88c019b18b395c863c52379e585afaa44 Mon Sep 17 00:00:00 2001 From: Eaton Date: Thu, 21 May 2020 03:43:52 -0400 Subject: [PATCH] fix: Application.Restart throws InvalidOperationException (#2845) --- .../src/System/Windows/Forms/Application.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Application.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Application.cs index 291b2909af8..4d2a234de07 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Application.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Application.cs @@ -1160,7 +1160,7 @@ public static void Restart() sb.Append(arguments[arguments.Length - 1]); sb.Append('"'); } - ProcessStartInfo currentStartInfo = Process.GetCurrentProcess().StartInfo; + ProcessStartInfo currentStartInfo = new ProcessStartInfo(); currentStartInfo.FileName = ExecutablePath; if (sb.Length > 0) {