I have a project in C# and I get this error every time I try to compile the project:
(Unable to copy file \"obj\\Debug\\Project1.exe\" to \"bin\\Debug
Solution1:
Solution2:
Add the following code in pre-build event:
attrib -r $(OutDir)*..\* /s
This command line code will remove the ready-only attribute of "bin" folder. Now visual studio can easily delete and copy new dlls.