On every build, I copy a few managed and unmanaged libraries to my $(TargetDir)libs\ folder. However, since I'm referencing one of the managed dlls in Visual Studio, somehow the Visual Studio Hosting Process (vshost.exe) locks the file, resulting in a exit code 1 from copy.
What can I do about this?
You can disable the hosting process from project properties. It's in the Debug tab, as below: