I am writing a program to format and aggregate data to make it processable for power automate. However, I just noticed that one of my applications is able to run more than once at the same time, even though I used a mutex to surpress that behaviour.
Here is the code:
//Some code
string mutexName = "MutexName";
bool newC;
Mutex mutex = new(true, mutexName, out newC);
if (!newC)
{
return;
}
//Some code
I am using the windows task scheduler to automatically start it everyday to restart it when it crashes. At first it worked fine and didn't cause any issues. But since yesterday it suddenly starts to just ignore the application running twice. The pc is acting as a server and is running constantly.
Thanks in advance!