Could not copy “obj\\Debug\\{project}.dll” to “bin\\{project}.dll”


Visual Studio Express 2013 for web has been throwing this error a lot lately when I try to run my project, and the only resolution I have found is to quit and relaunch Visual Studio or (sometimes) completely restart Windows. What could cause something like this?

<strong>Full Error Dump</strong>

Error 19 Could not copy "obj\Debug\HobbsEventsMobile.dll" to "bin\HobbsEventsMobile.dll". Exceeded retry count of 10. Failed. HobbsEventsMobile Error 20 Unable to copy file "obj\Debug\HobbsEventsMobile.dll" to "bin\HobbsEventsMobile.dll". The process cannot access the file 'bin\HobbsEventsMobile.dll' because it is being used by another process. HobbsEventsMobile


Create a pre-build action in your project by going to project properties (right-click on the project in the solution explorer, and select the Properties option), select the Build Events tab. Add this code:

if exist "$(TargetPath).locked" del "$(TargetPath).locked" if not exist "$(TargetPath).locked" move "$(TargetPath)" "$(TargetPath).locked"

<a href="https://social.msdn.microsoft.com/Forums/en-US/5b71eb06-5047-483d-8fd3-b75c102d41e9/unable-to-copy-from-objdebug-to-bindebug?forum=Vsexpressinstall&prof=required" rel="nofollow">https://social.msdn.microsoft.com/Forums/en-US/5b71eb06-5047-483d-8fd3-b75c102d41e9/unable-to-copy-from-objdebug-to-bindebug?forum=Vsexpressinstall&prof=required</a>


1-Select Your Project

2-Go to view from view select property Page

3-make Sure That The <strong>Output path</strong> is empty like That

<a href="https://i.stack.imgur.com/Jrn2u.png" rel="nofollow"><img alt="enter image description here" class="b-lazy" data-src="https://i.stack.imgur.com/Jrn2u.png" data-original="https://i.stack.imgur.com/Jrn2u.png" src="https://etrip.eimg.top/images/2019/05/07/timg.gif" /></a>


The clue appears to be in the error message:

cannot access the file 'bin\HobbsEventsMobile.dll' because it is being used by another process

I would guess that the dll is still being used from a previous debug session. Can you kill the process that owns it? If you're not sure which process that is then run <a href="http://technet.microsoft.com/en-gb/sysinternals/bb896653.aspx" rel="nofollow">Process Explorer</a> and do Find on the dll name -- that will show the process that still has the dll open.

Another wild guess: did you run outside the debugger with Ctrl-F5? If so then that may also explain why the dll is still in use.


You can also make clean solution and before you buid again, check in debugging folder if the .dll files still there. If the clean solution doesn't work, you can try change the file name and build the solution. You will see those errors disapearing.


  • Mocking OpenXML with Moq
  • Automatic refactoring tools? [closed]
  • openTSDB REST API is not storing data
  • Proc sql: new and continue customers based on look back period
  • Waiting for QProcess to finish or duration to exceed [duplicate]
  • ImportError with importing keras
  • How to filter children based on whether the parent is filtered in D3?
  • Automate editable PDF
  • what is a good structure to save this data
  • Cycle R,G,B vales as HUE?
  • Using VCL Styles gives a exception / crash in TOpenDialog
  • bootstrappedUser - Jade or EJS to HTML
  • React / Webpack - “Module parse failed: Unexpected token - You may need an appropriate loader to han
  • DocuSign API Replace template document but keep fields
  • in Gwt, there are 2 different packages (or 2 options) for doing drag n Drop? Which one is better?
  • What is the diff. between default.properties and project.properties?
  • Implementing and using MinMax with four in row (connect4) game
  • didSelectItemAtIndexPath of UICollectionView inside of a UIScrollView is not getting called
  • characters not allowed in DOM ids by spec, and by browser
  • Php artisan optimize is failing on production server
  • Firestore: Version history of documents
  • How to get “crispEdges” for SVG text?
  • JQuery Mobile Ajax Navigation in Single-Page Template
  • How to add html image in to velocity template file to send email?
  • Ruby on Rails: Get mediaplayer information (iTunes, TRAKTOR, Cog; current song + playlist)
  • How to use Flask's render_template from an ajax POST form submit
  • how to specify different css for ie
  • How to merge objects within array based on attribute
  • concise way of flattening multiindex columns
  • VS2010 RDLC C#. How can I set a LocalReport object to a ReportViewer?
  • Is there a better way for handling SpatialPolygons that cross the antimeridian (date line)?
  • How to call jQuery function in HTML returned by AJAX
  • Stacked bar chart with continuous time-axis as x-axis
  • How do I add a mouse over tooltip to an Image using .DrawImage()
  • Using redis as an LRU cache for postgres
  • Why isn't stemDocument stemming?
  • How to warp text around image in iOS?
  • Did not understand process of initialize in swift programming
  • Make checkout phone field optional for specific countries in WooCommerce
  • Create/delete users from text file using Bash script