I'm trying like this:
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.ShowDialog();
string filePath = openFileDialog.FileName;
Process processo = Process.Start(filePath);
FileStream fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.None);
processo.WaitForExit();
MessageBox.Show("Wow!");
fileStream.Close();
It seems that fileStream blocks the file before it is opened, so from the error, one of the errors it gives is this:
---------------------------
Desenhar matriz.exe - This application could not be started.
---------------------------
This application could not be started.
Do you want to view information about this issue?
---------------------------
Sim Não
---------------------------