Kevin Cauchi
Kevin Cauchi

Reputation: 87

Opening files in net core (C#)

I am trying to open a file in net core as I would in full framework.

For example I am trying to open a sql file using: Process.Start(path).

It should have opened it with the default application but instead I get 'The specified executable is not a valid application for this OS platform.'.

Is there something I am missing?

Thanks

Upvotes: 0

Views: 939

Answers (1)

Kevin Cauchi
Kevin Cauchi

Reputation: 87

I finally found the way:

Process.Start(new ProcessStartInfo("cmd", $"/c start {anyFileName}"));

Upvotes: 1

Related Questions