I have a number of services that read xml files. To make sure there are no collisions, I use a mutex. For any reason, if all my services are running by the same user, there is no problem. However, if there are different users running these services, even after one service has released the mutex, the other gets the following exception when calling enter route mutex "Unhandled Exception: System.TypeInitializationException: the type initializer for" createMutex.Program "threw an exception. - -> System.UnauthorizedAccessException: access to the path "RETEST_MUTEX" is denied.
public static readonly String ROUTE_MUTEX_STRING = "RETEST_MUTEX"; private static Mutex _routeMutex = new Mutex(false, ROUTE_MUTEX_STRING);
source share