This is because by default, the process is started with UseShellExecute
set to false
, which means that the process can only run executable files (such as .exe
files).
Instead, specific UseShellExecute = true
to allow the OS to determine how to launch the process, as per the following example:
Process newProcess = new Process();
newProcess.StartInfo.FileName = "https://www.example.com";
newProcess.StartInfo.UseShellExecute = true;
newProcess.Start();
The docs for UseShellExecute
state:
Gets or sets a value indicating whether to use the operating system shell to start the process.
In this case, you do want that.