I keep getting:
warning MSB3026: Could not copy dlls errors.
I have several projects in the solution.
On build, I also get the error:
Error 47 Could not copy "myapp\bin\Debug*.dll" to "bin*.dll". Exceeded retry count of 10. Failed.
The application just stops responding in the middle of debugging, and I have to close Visual Studio every time. Which was annoying, but now it's getting frustrating as well.
We are eight team members, and all of us are getting the same error. We can't rebuild the solution, and the application is running very slow.
One of things we are using in the project is SignalR.
These are the things I have tried so far. They didn't help me, but they might help the reader:
I have tried solutions described in Visual Studio debugging/loading very slow, but that didn't work.
I have also tried unchecking Enable the Visual Studio hosting process in each project properties and that didn't fix the issue either.
Solutions are described in http://www.richard-banks.org/2008/04/how-to-fix-problems-with-locked-files.html and http://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/40ed753e-47af-4638-8a72-1d607102a05c/
Pre-build scripts on the projects:
if exist "$(TargetPath).locked" del "$(TargetPath).locked" if exist "$(TargetPath)" if not exist "$(TargetPath).locked" move "$(TargetPath)" "$(TargetPath).locked"
The bin folders are not under source control.
Sometimes killing the Microsoft.VisualStudio.Web.Host.exe process releases the lock on the files, but this does not always work.
I am running Visual Studio in administrator mode.
I have full access (permissions read/write) on the source code folders.
I ran into this issue as well, seems like a known bug in VS that randomly gets people from time to time in 2010, 2012 and 2013, I tried many of the suggestions here, as well as few found on other sites, none worked. What helped me was going into the debug properties for the project and clearing "Enable Visual Studio Hosting process", rebuild all and no more error.
Hopefully this will work for you, but that said, as it is a known reported bug in VS itself, we might all be fixing the symptoms and luckily doing something to clear the file lock and the real problem remains in VS.
This issue had been plaguing my development for sometime. Regardless of disabling the Read Only security permission and modifying access rights of the affect dlls.
I resolved the issue by ensuring the Security Permissions on the parent folder of solution allowed the computer's administrator read and write access and then ran Visual Studio in Administrator mode.
This is generally a permissions issue with your bin directory. Navigate to it in Windows Explorer and make sure readonly is off. If you get an error changing the read status of the directory, make sure you're running on an administrator-level account or elevate accordingly. Once write permissions are re-enabled, your build should work fine.
Same issue for me. Solution was that I had my debugger still running the program in the background.
Clean Solution, then Rebuild Solution fixed this issue for me.
The first time I tried to perform a Clean, I got an access violation error.
To remedy that, I exited VS, manually deleted the bin folder, and opened it back up. Then I could perform the Clean.
This had nothing to do with permissions or access level.
Ensuring the output directory was not read-only and running VS as Admin did not help.
Please refer to Visual Studio “Could not copy” … during build.
I had this issue several days ago and tried many approaches but the solution that worked for me was stopping a windows service that was used by some class libraries from the project.