According to the
Mutex[
^] documentation, you can use a third parameter to determine if the Mutex already exists and allow you to exit the application if it is the case. Something similar to:
var mutex = new Mutex(true, "myapplication", out bool created);
if (!created) {
}