File.Copy locks source file after completion

后端 未结 2 1120
伪装坚强ぢ
伪装坚强ぢ 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.

提交回复
热议问题