Severity Code Description Project File Line Suppression State
Error CS2012 Cannot open 'c:\users\user\documents\visual studio 2015\Projects\blahtest1\blahtest1\obj\Debug\blahtest1.exe' for writing -- 'Access to the path 'c:\users\user\documents\visual studio 2015\Projects\blahtest1\blahtest1\obj\Debug\blahtest1.exe' is denied.' blahtest1 c:\users\user\documents\visual studio 2015\Projects\blahtest1\blahtest1\CSC 1 Active
C:\Users\user\Documents\Visual Studio 2015\Projects\blahtest1\blahtest1
>type refreshprog.bat
dir /b ".\bin\Debug\*.exe"
dir /b ".\obj\Debug\*.exe"
del ".\bin\Debug\*.exe"
del ".\obj\Debug\*.exe"
C:\Users\user\Documents\Visual Studio 2015\Projects\blahtest1\blahtest1
>
有时我会尝试用一个程序来解锁这些文件,比如iobit unlocker或unlocker。然后删除它们。
Severity Code Description Project File Line Suppression State
Error Unable to copy file "obj\Debug\blahtest1.exe" to "bin\Debug\blahtest1.exe". The process cannot access the file 'bin\Debug\blahtest1.exe' because it is being used by another process. blahtest1
Error Could not copy "obj\Debug\blahtest1.exe" to "bin\Debug\blahtest1.exe". Exceeded retry count of 10. Failed. blahtest1
Severity Code Description Project File Line Suppression State
Error Unable to delete file "c:\users\user\documents\visual studio 2015\Projects\blahtest1\blahtest1\bin\Debug\chromedriver.exe". Access to the path 'c:\users\user\documents\visual studio 2015\Projects\blahtest1\blahtest1\bin\Debug\chromedriver.exe' is denied. blahtest1
它可以是一个准系统程序,也可以是一个主方法中没有任何内容的控制台应用程序。它可能是一个Winforms程序。
我可以右键单击该配置文件,查看它是否为只读,取消选中它,尝试应用到所有子文件夹,然后收到拒绝访问的消息。
如果我查看在问题发生之前创建的旧项目,我会发现它们也显示为只读的。所以我不知道文件夹是否是只读的。但不管怎样,我不能把它们以只读方式删除。
然后我又试了一次,它说找不到那个exe文件。(也许是我删除了它,或者是vs删除了,我不知道)。但后来我又尝试使文件夹不再是只读的,它声称它不是只读的。然后我再次转到文件夹的属性,它再次显示为只读!
只读部分似乎没有问题,因为有时VS会尝试重新生成或清理项目,而当项目文件夹设置为只读时,它仍然会管理项目。
我刚刚试了几次,发现当它不工作时,我可以用Process Explorer看到它被系统PID-4锁定,所以这对我没什么帮助,因为它没有告诉我锁定它的是什么。然后我尝试结束任务探索者。然后成功了。然后我再次检查了ProcessExplorer,它显示它被PID-4锁定,但这次Visual Studio可以写入。
我真的不知道该怎么处理这件事!我有这个问题好几个月了。我的硬盘驱动器现在有点低,像500MB左边。但我想我可能在剩下几GB的时候遇到了这个问题。其他程序运行正常。