Click here to Skip to main content
15,938,848 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
After converting WPF MS framework 4.8 project to net 8
the process.start(url) no longer works.

private void DG_Hyperlink_Click(object sender, RoutedEventArgs e)
Hyperlink link = (Hyperlink)e.OriginalSource;

System.ComponentModel.Win32Exception: "An error occurred trying to start process '' with working directory 'E:\Visual Studio\Code Project\DataGridPlus\DataGridPlus\bin\Debug\net8.0-windows'. Das System kann die angegebene Datei nicht finden."

=> cannot find related file

How do I fix this?

What I have tried:

Tried a variant for start url:

Hyperlink link = (Hyperlink)e.OriginalSource;
new ProcessStartInfo("start " + link.NavigateUri.AbsoluteUri);
Updated 21-Apr-24 5:57am

Here is a working example:
string link = "";

Process? process = Process.Start(new ProcessStartInfo(link)
    UseShellExecute = true


You can also see it in use in this .Net Core article: .NET Silent ClickOnce Installer for Winform & WPF in C# & VB[^]
Share this answer
Comments 21-Apr-24 19:47pm    
Great + thanks.

Adjusted it and that works:

private void DG_Hyperlink_Click(object sender, RoutedEventArgs e)

Hyperlink link = (Hyperlink)e.OriginalSource;
Process? process = Process.Start(new ProcessStartInfo(link.NavigateUri.AbsoluteUri)
UseShellExecute = true

Graeme_Grant 24-Apr-24 4:52am    
All good. I would have gone into more details however was on the way out the door to take the wife & kids camping...
Try setting UseShellExecute to true. This will use the default application to start the process.
Share this answer
Comments 21-Apr-24 13:22pm    

using (Process compiler = new Process())
compiler.StartInfo.FileName = "explorer.exe";

compiler.StartInfo.Arguments = link.NavigateUri.AbsoluteUri;
compiler.StartInfo.UseShellExecute = false;
compiler.StartInfo.RedirectStandardOutput = true;


Shows error:// "No process is associated with this object."

Found this solution (not default browser but it works)

Process.Start("explorer.exe", link.NavigateUri.AbsoluteUri);

Thanks for your help.
Pete O'Hanlon 21-Apr-24 13:36pm    
You set it to false in your code. It needs to be true. 21-Apr-24 14:00pm    
Unfortunately with
compiler.StartInfo.UseShellExecute = true;
the same error happens as before.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900