Fix Process.Start for .Net Core

This commit is contained in:
punker76
2020-11-23 11:48:57 +01:00
parent 011a2e74b4
commit 7bf780d032
2 changed files with 14 additions and 2 deletions

View File

@@ -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;
}
}

View File

@@ -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;
}