Sometimes it is Visual Studio’s fault: failure to copy file in a post build event
Posted by jpluimers on 2016/02/25
Not sure yet why, but every now and then I get a failure like this in Visual Studio (at least in 2013 and up):
2>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(4548,5): error MSB3073: The command "copy /Y "C:\SomePath\SomeProjectName\bin\Debug\SomeProjectName.dll" "C:\SomePath\Shared Assemblies\"" exited with code 1.
2>Done executing task "Exec" -- FAILED.
Most of the times it is me at fault: some process still is using it.
But sometimes, it is devenv.exe (Visual Studio itself) that keeps it locked, even though nothing is running (in fact it can happen right after you loaded the project in Visual Studio 2013).
I found this out by using “Process Explorer Search” (Ctrl+F or Find Handle or DLL).
Not sure why yet.
–jeroen
Leave a Reply