Reputation: 377
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!
Upvotes: 8
Views: 2995
Reputation: 5576
Open it like such:
new Process
{
StartInfo = new ProcessStartInfo(filename)
{
UseShellExecute = true
}
}.Start();
Upvotes: 23