Unable to copy file "obj\Debug\project.dll" to "bin\project.dll". Access to the path 'bin\project.dll' is denied
i am 开发者_StackOverflowhaving this error when trying to build a solution in visual studio 2008. What does that mean?
It probably means that the file bin\project.dll
is locked for writing by another process (possibly another instance of Visual Studio).
You should try closing down all instances of VS and any other programs that could be attempting to read that file, then re-open Visual Studio and try to build again.
If that doesn't work then you can try using Process Explorer to work out what process is locking that file.
I followed the steps below.
- Go to “bin" folder. In some cases it may be "\bin" - one level up of the current.
- View the properties of the dll file and see whether it is marked as "Read Only". If read only check box checked, uncheck it.
This happens if the project is under any source control system.
Also refer Unable to copy a file from obj\Debug to bin\Debug
In my case, I was migrating code in TFS and wanted to use a new local mapping, too. So I just copied the local source code to the new local location, then added it to the TFS store via Visual Studio source control explorer. When I tried to do a build I got the same error as in the question, but then I realised I had also copied the bin folder (though it had been excluded in the Add operation). So I simply deleted the bin folder locally and then I was able to build the solution successfully.
There may be an AntiVirus program blocking it. Go to your AntiVirus virus vault and check if it block the file and restore it. Most AntiVirus program block suspicious file even if the file my not seem harmful.
精彩评论