From 7bf780d0323ab118e430c4cec5464e7f83a2d41e Mon Sep 17 00:00:00 2001 From: punker76 Date: Mon, 23 Nov 2020 11:48:57 +0100 Subject: [PATCH] Fix Process.Start for .Net Core --- src/NotifyIconWpf.Sample.ShowCases/Main.xaml.cs | 8 +++++++- .../Showcase/ShowcaseWindow.xaml.cs | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/NotifyIconWpf.Sample.ShowCases/Main.xaml.cs b/src/NotifyIconWpf.Sample.ShowCases/Main.xaml.cs index 68d9bdc..e780b2f 100644 --- a/src/NotifyIconWpf.Sample.ShowCases/Main.xaml.cs +++ b/src/NotifyIconWpf.Sample.ShowCases/Main.xaml.cs @@ -117,7 +117,13 @@ namespace NotifyIconWpf.Sample.ShowCases private void OnNavigationRequest(object sender, System.Windows.Navigation.RequestNavigateEventArgs e) { - Process.Start(e.Uri.ToString()); + Process.Start(new ProcessStartInfo + { + FileName = e.Uri.ToString(), + // UseShellExecute is default to false on .NET Core while true on .NET Framework. + // Only this value is set to true, the url link can be opened. + UseShellExecute = true + }); e.Handled = true; } } diff --git a/src/NotifyIconWpf.Sample.ShowCases/Showcase/ShowcaseWindow.xaml.cs b/src/NotifyIconWpf.Sample.ShowCases/Showcase/ShowcaseWindow.xaml.cs index e00c9f8..3e1be6e 100644 --- a/src/NotifyIconWpf.Sample.ShowCases/Showcase/ShowcaseWindow.xaml.cs +++ b/src/NotifyIconWpf.Sample.ShowCases/Showcase/ShowcaseWindow.xaml.cs @@ -77,7 +77,13 @@ namespace NotifyIconWpf.Sample.ShowCases.Showcase private void OnNavigationRequest(object sender, RequestNavigateEventArgs e) { - Process.Start(e.Uri.ToString()); + Process.Start(new ProcessStartInfo + { + FileName = e.Uri.ToString(), + // UseShellExecute is default to false on .NET Core while true on .NET Framework. + // Only this value is set to true, the url link can be opened. + UseShellExecute = true + }); e.Handled = true; }