Opening a file in the browser with .Net Core

Sami C.
1 min readSep 4, 2019

--

Opening a file in the in browser?

.Net Framework 4.8.0

Process.Start(@"C:\Users\user2\Desktop\XXXX.reg")

.Net core 2.2

var p = new Process();
p.StartInfo = new ProcessStartInfo(@"C:\Users\user2\Desktop\XXXX.reg")
{
UseShellExecute = true //this is important
};
p.Start();

More information about the old issue with process.startInfo can be found here:

Happy coding! :)

--

--

Sami C.
Sami C.

Written by Sami C.

Freelance Software Engineer

No responses yet