Visual Studio Could not copy .... during build
I have encountered similar error messages in Visual Studio 2013.
Mostly, I have found that this situation has occurred when a debug process was halted because of an exception.
When clean+build has not resolved this problem for me, I have had success by doing the following:
- Closing Visual Studio
- Deleting the
bin
andobj
folders, and - Reopening Visual Studio.
This "bug" has existed since Visual Studio 2003.
Finally, I have also found that I can often overcome this problem by simply renaming the executable file and then deleting it.
Visual Studio Could not copy .... during build
I have encountered similar error messages in Visual Studio 2013.
Mostly, I have found that this situation has occurred when a debug process was halted because of an exception.
When clean+build has not resolved this problem for me, I have had success by doing the following:
- Closing Visual Studio
- Deleting the
bin
andobj
folders, and - Reopening Visual Studio.
This "bug" has existed since Visual Studio 2003.
Finally, I have also found that I can often overcome this problem by simply renaming the executable file and then deleting it.
Error Could not copy the file obj\Debug\[project-name].dll because it was not found
This is most probably bug in VS2019.
According to some comments on https://developercommunity.visualstudio.com/content/problem/519499/could-not-copy-the-file-objx64debugmanagementexe-b.html it helps to unload and reload the project. It helped for me.
Build fails with Could not copy the file.. because it was not found in Visual Studio 2013
Uninstalling the "Productivity Power Tools" extension in Visual Studio 2013, restarting Visual Studio and rebuilding did it for me. I found this workaround here:
https://connect.microsoft.com/VisualStudio/feedback/details/533411
Opentap Could not copy [name].dll to bin\Debug\Dependencies\[Name].dll . Exceeded retry count of 10. Failed
Just for everyone who is interested what is the solution.
The problem with I hade was, that Visual Studio has problems to solve the dependencies. Due to an test I tried to recreate an project on the same path and moved the old project to my desktop. Than to look at the code I opened the old project and after that it worked.
Solution
Visual Studio is not able to solve the dependencies when the path is to long. Now I have changed the path and it works.
Related Topics
Hyphenated HTML Attributes with ASP.NET MVC
Escape Special Character in Regex
How to Install a Windows Service Programmatically in C#
How to Wait for a Backgroundworker to Cancel
Generate and Sign Certificate Request Using Pure .Net Framework
Showing a Windows Form on a Secondary Monitor
Windows Phone 8.1 Universal App Terminates on Navigating Back from Second Page
Embedding One Dll Inside Another as an Embedded Resource and Then Calling It from My Code
Entity Framework Self Referencing Loop Detected
Setting Datacontext in Xaml in Wpf
How to Call a Vbscript File in a C# Application
How Big Is an Object Reference in .Net
How to Execute Code That Is in a String