VS2013: 'warning MSB3061: Unable to delete file' when building a COM interop project

ikantspelwurdz

Well-known member
Joined
Dec 8, 2009
Messages
49
Programming Experience
1-3
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.CurrentVersion.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:

Herman

Well-known member
Joined
Oct 18, 2011
Messages
882
Location
Montreal, QC, CA
Programming Experience
10+
That just means that the library is in use. You must have a program running that references it. Kill it before rebuilding.
 

ikantspelwurdz

Well-known member
Joined
Dec 8, 2009
Messages
49
Programming Experience
1-3
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.
 
Top Bottom