正由另一进程使用,因此该进程无法访问该文件。
在 System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
在 System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
在 System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
这是由于多线程出现互斥,一个文件没关闭,继续写入数据流而产生的异常。
经过lock加锁没能解决问题,后来觉得用互斥量比较不错,经测试问题解决,异常通知没有了。