Unable to copy file reference.dll to bin/reference.dll. The process cannot access the file reference.dll because it is being used by another process

Last post 07-11-2009 4:06 PM by jtoth55. 3 replies.

Sort Posts:

  • Unable to copy file reference.dll to bin/reference.dll. The process cannot access the file reference.dll because it is being used by another process

    07-09-2009, 2:22 PM
    • Member
      449 point Member
    • jtoth55
    • Member since 03-21-2005, 8:17 PM
    • Maryland
    • Posts 158

     Hey all,

    For one of my ASP.NET 3.5 applications, every single time I try to build the web app, it throws the following build errors:

    Error 165 Unable to copy file "C:\InOne\Common\DexProcessor\bin\Debug\DexProcessor.dll" to "bin\DexProcessor.dll". The process cannot access the file 'bin\DexProcessor.dll' because it is being used by another process. InVision2
    Error 166 Unable to copy file "C:\InOne\Common\DexParser\bin\Debug\InOne.DexParser.dll" to "bin\InOne.DexParser.dll". The process cannot access the file 'bin\InOne.DexParser.dll' because it is being used by another process. InVision2
    Error 167 Unable to copy file "C:\InOne\Common\AlertProcessor\bin\Debug\InOne.Invision.AlertProcessing.dll" to "bin\InOne.Invision.AlertProcessing.dll". The process cannot access the file 'bin\InOne.Invision.AlertProcessing.dll' because it is being used by another process. InVision2
    Error 168 Unable to copy file "C:\InOne\Common\InVision.BusinessLogic\bin\Debug\InVision.BusinessLogic.dll" to "bin\InVision.BusinessLogic.dll". The process cannot access the file 'bin\InVision.BusinessLogic.dll' because it is being used by another process. InVision2
    Error 169 Unable to copy file "C:\InOne\Common\InVision.Common\bin\Debug\InVision.Common.dll" to "bin\InVision.Common.dll". The process cannot access the file 'bin\InVision.Common.dll' because it is being used by another process. InVision2
    Error 170 Unable to copy file "C:\InOne\Data\bin\Debug\InVision.Data.dll" to "bin\InVision.Data.dll". The process cannot access the file 'bin\InVision.Data.dll' because it is being used by another process. InVision2
    Error 171 Unable to copy file "C:\InOne\Common\InVision.DataAccessLayer\bin\Debug\InVision.DataAccessLayer.dll" to "bin\InVision.DataAccessLayer.dll". The process cannot access the file 'bin\InVision.DataAccessLayer.dll' because it is being used by another process. InVision2
    Error 172 Unable to copy file "C:\InOne\Common\InVision.DataAccessLayer.SqlClient\bin\Debug\InVision.DataAccessLayer.SqlClient.dll" to "bin\InVision.DataAccessLayer.SqlClient.dll". The process cannot access the file 'bin\InVision.DataAccessLayer.SqlClient.dll' because it is being used by another process. InVision2

    I read online to add some pre-build events but that didn't work for me. I also tried adding to the project files:

    <GenerateResourceNeverLockTypeAssemblies>true</GenerateResourceNeverLockTypeAssemblies>

    This just started happening a couple days ago and is very annoying... I have to go into the web app's bin folder and delete the pdb files and then it'll let me delete the dll's most of the time. Every once in a while it doesn't let me so I have to close Visual Studio and then it lets me delete them.

    This is really reducing my productivity, is there anything I can do to resolve this?

    Thanks,

    Justin

    Justin Toth
    http://tothsolutions.com
    http://tothsolutions.com/blog
  • Re: Unable to copy file reference.dll to bin/reference.dll. The process cannot access the file reference.dll because it is being used by another process

    07-09-2009, 3:04 PM
    • Contributor
      6,104 point Contributor
    • atconway
    • Member since 09-24-2007, 9:20 PM
    • Florida U.S.A
    • Posts 1,259

     Ok I assume since this has been a few days I would have assumed you have tried to re-boot, but some people develop for days on end without re-starting; have you done this (just as a check mark). 

    I have had this happen to me at least a half dozen times since developing in VS.NET 2008.  Sometimes, I believe that one of the WebDev.WebServer.exe processes (icon that is down in the tray when debugging a project; can be shut down in TaskManager) gets hung up and locks those files.

    For me 1 of (3) things has fixed this issue.

    1. Restarting Visual Studio
    2. Shutting down all instances of WebDev.WebServer.exe either manually or via TaskManager in Windows.
    3. Re-booting the machine.

    One last effort may be to clear any temporary cached files that VS.NET is using.  Here is an article on clearing them:

    http://robertbogley.wordpress.com/2007/09/19/how-to-speed-up-loading-time-in-microsoft-visual-studionet-2005-projects/

    ...by the way the folder location for Step # 2 from the above link if using Vista is as follows:

    C:\Users\[UserName]\AppData\Local\Microsoft\WebsiteCache

    Hope this helps!

    Thank you,   >[Blog]<

    "The best thing about a boolean is even if you are wrong, you are only off by a bit." :D
    -anonymous

  • Re: Unable to copy file reference.dll to bin/reference.dll. The process cannot access the file reference.dll because it is being used by another process

    07-09-2009, 4:38 PM
    • Member
      449 point Member
    • jtoth55
    • Member since 03-21-2005, 8:17 PM
    • Maryland
    • Posts 158

    Thanks for the quick reply.

    I use IIS rather than the web dev server so that one isn't an issue. I've tried rebooting multiple times and resetting iis to no avail. I read the post and cleared all of those temp directories, then rebooted, and the first rebuild it still gives the errors...

    Any other things I can try??

    Justin Toth
    http://tothsolutions.com
    http://tothsolutions.com/blog
  • Re: Unable to copy file reference.dll to bin/reference.dll. The process cannot access the file reference.dll because it is being used by another process

    07-11-2009, 4:06 PM
    • Member
      449 point Member
    • jtoth55
    • Member since 03-21-2005, 8:17 PM
    • Maryland
    • Posts 158

    :: bump :: 

    Justin Toth
    http://tothsolutions.com
    http://tothsolutions.com/blog
Page 1 of 1 (4 items)