6

In .NET Framework I can simply do Process.Start(filename); butin .NET Core I get this exception:

System.ComponentModel.Win32Exception: 'The specified executable is not a valid application for this OS platform.'

How can I start testfile.txt with my default app? Thank you!

5

1 Answer 1

18

Open it like such:

new Process
{
    StartInfo = new ProcessStartInfo(filename)
    {
        UseShellExecute = true
    }
}.Start();
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.