Unable to copy file - access to the path is denied

Solution 1:

I solved this problem by deleting the contentious files from bin folder and rebuilding the project.

Solution 2:

Just make sure that the folder is NOT Read-Only and rebuild the solution

Solution 3:

I solved this problem: Close Visual Studio, open it again and load the solution, Rebuild your solution. My problem occurred using TFS and VIsual Studio 2010.

Solution 4:

Kill process VBCSCompiler.exe and rebuild.

Solution 5:

I stepped into this problem too.

First go and check if you have mapped your bin and obj folder to the Source Control program.

This may be turning your files from binaries folders into read only archives, which make impossible to visual studio to overwrite them when it compiles the code.

Go and remove the mapping from these folders, check the changes and try again.

My problem occurred using TFS(Team foundation server) and Visual Studio 2010.

Hope this helps someone.