File.Copy locks source file after completion

后端 未结 2 1117
伪装坚强ぢ
伪装坚强ぢ 2021-01-03 20:36

We are trying to copy a file from a server, down to a local machine in a .NET 2.0 application (C#), but keep having the source file unnecessarily locked. We suspect it is so

相关标签:
2条回答
  • 2021-01-03 21:24

    It is probably the McAfee on-access scanner that holds the lock. If you only use read access, it is bypassed. I believe that you can use the Sysinternals Process Viewer tool (free from Microsoft) to confirm that.

    Not sure what subscription you have for McAfee, but you can define exception rules so that it does not scan this file.

    0 讨论(0)
  • 2021-01-03 21:36

    I am not able to replicate this on our file servers.

    However, I do know Opportunistic locking is disabled since we're using PeerLock by PeerSoftware.

    0 讨论(0)
提交回复
热议问题