Results 1 to 4 of 4

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

  1. #1
    ikantspelwurdz is offline VB.NET Forum Enthusiast
    .NET Framework
    .NET 3.5
    Join Date
    Dec 2009
    Posts
    49
    Reputation
    92

    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.

  2. #2
    Herman is offline VB.NET Forum Idol
    .NET Framework
    .NET 4.0
    Join Date
    Oct 2011
    Location
    Montreal, QC, CA
    Posts
    866
    Reputation
    1213
    That just means that the library is in use. You must have a program running that references it. Kill it before rebuilding.

  3. #3
    ikantspelwurdz is offline VB.NET Forum Enthusiast
    .NET Framework
    .NET 3.5
    Join Date
    Dec 2009
    Posts
    49
    Reputation
    92
    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.

  4. #4
    Herman is offline VB.NET Forum Idol
    .NET Framework
    .NET 4.0
    Join Date
    Oct 2011
    Location
    Montreal, QC, CA
    Posts
    866
    Reputation
    1213
    Anti-virus package might prevent deleting it if it is registered...?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •