I'm trying to create a named mutex, but when I call the constructor I get a DirectoryNotFoundException
! Why is a mutex trying to access the filesystem, and how do I know what is a valid path? Is there any particular directory the mutex should be placed in, and how does that correspond to the name?
EDIT: I'm using the Mutex(bool, string)
overload, and the exception is:
System.IO.DirectoryNotFoundException: Could not find a part of the path '<mutex name>'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.Threading.Mutex.<>c__DisplayClass3.<.ctor>b__0(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.Mutex..ctor(Boolean initiallyOwned, String name, Boolean& createdNew, MutexSecurity mutexSecurity)
at System.Threading.Mutex..ctor(Boolean initiallyOwned, String name)