且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

该进程无法访问该文件,因为该文件正在被另一个文件使用

更新时间:2022-01-23 23:19:21

可能是您的代码正在使用该文件:检查在哪里创建和使用临时文件,并确保完成后已正确关闭并释放了所有文件流和相关对象.只是让它们超出范围并不能做到这一点-它等待垃圾收集器执行,这可能要花费数周的时间!
The chances are it is your code that is using the file: check where you create and use the temporary file, and ensure that you have correctly Closed and Disposed all file streams and related objects when you have finished with it. Just letting them go out of scope does not do this - it waits for the Garbage collector to do it which may not be for weeks!