Ashu
Ashu

Reputation: 477

visual studio 2013 Could not copy "obj\Debug\.dll" to "bin\Debug\.dll".

during building application i am getting following error

Frequently I am getting this error. Even i have killed the process so many times. Please help.

Upvotes: 2

Views: 1643

Answers (5)

Rolwin Crasta
Rolwin Crasta

Reputation: 4339

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"

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

Upvotes: 0

Adam Rydzewski
Adam Rydzewski

Reputation: 1

I had the same problem, the solution was: Uncheck the "sign the ClickOnce manifests." in Procject Properties/Signing. Some days I checked it to the test and I forgot to uncheck.

Upvotes: 0

narmaps
narmaps

Reputation: 413

I experienced this on a project created in VS2010 and then opening it in VS2015. When I went back to VS2010 two things had changed:

  1. In the project settings the debug workspace folder had been cleared.
  2. The "use Visual Studio host" button had been unchecked.

I set the workspace to my debug folder and checked the "use host" checkbox and VS2010 was able to properly debug/code/debug multiple times again.

Upvotes: 0

Tzach Ovadia
Tzach Ovadia

Reputation: 1316

This usually happens when a file is in use by another process that runs with different user.

Try deleting these files manually (go to the debug folder and delete) and then build your solution.

Make sure you are not debugging while deleting.

Upvotes: 1

Bogdan Mocanu
Bogdan Mocanu

Reputation: 91

Try start visual studio with administrator privilege

Upvotes: 2

Related Questions