From cb9274c1c6fd6eef8ce2ece8a160c90adfc60439 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 31 Mar 2021 10:35:03 +0800 Subject: [PATCH] fix<*>: fix Process.Start with URL directly will crash on .NET 5.0 --- src/UI/About.xaml.cs | 4 ++-- src/UI/UpdateAvailable.xaml.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/UI/About.xaml.cs b/src/UI/About.xaml.cs index 55948d98..46b3f4d9 100644 --- a/src/UI/About.xaml.cs +++ b/src/UI/About.xaml.cs @@ -30,8 +30,8 @@ namespace SourceGit.UI { /// /// private void OpenSource(object sender, RequestNavigateEventArgs e) { - Process.Start(e.Uri.AbsoluteUri); - //Process.Start(new ProcessStartInfo("cmd", $"/c start {e.Uri.AbsoluteUri}") { CreateNoWindow = true }); + //Process.Start(e.Uri.AbsoluteUri); + Process.Start(new ProcessStartInfo("cmd", $"/c start {e.Uri.AbsoluteUri}") { CreateNoWindow = true }); e.Handled = true; } diff --git a/src/UI/UpdateAvailable.xaml.cs b/src/UI/UpdateAvailable.xaml.cs index a1f2e387..f2b0f101 100644 --- a/src/UI/UpdateAvailable.xaml.cs +++ b/src/UI/UpdateAvailable.xaml.cs @@ -32,8 +32,8 @@ namespace SourceGit.UI { /// /// private void Download(object sender, RoutedEventArgs e) { - Process.Start($"https://gitee.com/sourcegit/SourceGit/releases/{tag}"); - //Process.Start(new ProcessStartInfo("cmd", $"/c start https://gitee.com/sourcegit/SourceGit/releases/{tag}") { CreateNoWindow = true }); + //Process.Start($"https://gitee.com/sourcegit/SourceGit/releases/{tag}"); + Process.Start(new ProcessStartInfo("cmd", $"/c start https://gitee.com/sourcegit/SourceGit/releases/{tag}") { CreateNoWindow = true }); e.Handled = true; }