VS2013: 'warning MSB3061: Unable to delete file' when building a COM interop project
I've migrated from VS2010 to VS2013, and am running into a rather annoying issue. I have a project with 'Register for COM Interop' checked off. Half the time when I rebuild or clean, I get this:
C:\Program Files\MSBuild\12.0\bin\Microsoft.Common.CurrentVer sion.targets(4319,5): warning MSB3061: Unable to delete file "c:\projects\ClassLibrary2\ClassLibrary2\bin\Debug \ClassLibrary2.dll". Access to the path 'c:\projects\ClassLibrary2\ClassLibrary2\bin\Debug \ClassLibrary2.dll' is denied.
If I keep hitting rebuild repeatedly, it will eventually work. But this is going to get annoying really fast.
When I uncheck 'Register for COM Interop,' it rebuilds fine every single time.
Also, disabling UAC entirely does nothing. Just thought I'd try that.
Last edited by ikantspelwurdz; 03-24-2015 at 12:13 PM.
That just means that the library is in use. You must have a program running that references it. Kill it before rebuilding.
Not even possible. I can create a brand new library project, set it to "Register for COM Interop," build, then rebuild and get that error message. No program could possibly be referencing it, because I created it ten seconds ago.
Anti-virus package might prevent deleting it if it is registered...?