i am having this error when trying to build a solution in visual studio 2008. What does that mean?
-
More answers here: http://stackoverflow.com/questions/1923543/unable-to-copy-file-to-server-on-build-access-to-path-is-denied – John Ferguson Sep 25 '13 at 12:55
4 Answers
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.

- 84,773
- 49
- 224
- 367
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.

- 786
- 1
- 7
- 21
-
Helped me in vs2013 Ultimate. Note to Microsoft, this should have been automagically corrected. – id.ot Jul 21 '15 at 06:22
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.

- 331
- 2
- 9