我正在尝试创建一个命名互斥体,但是当我调用构造函数时,我会收到一个
编辑:我正在使用
DirectoryNotFoundException
!为什么互斥体要访问文件系统,我如何知道什么是有效的路径?是否有特定的目录应放置互斥体,以及它如何对应名称?编辑:我正在使用
Mutex(bool, string)
重载,并且异常是: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)