Reputation: 662
I am constantly this error in debug mode.
Severity Code Description Project File Line Suppression State Error MSB3027 Could not copy "C:\Users\N3617\Source\Repos\Core\CoreData\ConsoleApp1\obj\Debug\netcoreapp3.1\ConsoleApp1.exe" to "bin\Debug\netcoreapp3.1\ConsoleApp1.exe". Exceeded retry count of 10. Failed. The file is locked by: "ConsoleApp1 (1080)" ConsoleApp1 C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets 4643
I had to restart system to get rid off this error. Can anyone tell why is this happening?
Upvotes: 0
Views: 1954
Reputation: 23715
It seems an old problem that your project is locked by some other process due to some reasons. You can see this similar issue.
It is complex to explain that but you can try the following steps if you faced them next time:
Suggestion
1) open Task Manager--> shut down ConsoleApp1.exe
process, any dotnet
process, NET Core Host
process or similar process every time when you faced this issue and then build your project again.
2) close VS, delete .vs
hidden folder under solution folder, bin
and obj
folder and then restart VS
3) enter Tools
-->Options
-->Projects and Solutions
-->Build and Run
-->set maximum numbers of parallel project builds
to 1
.
4) uncheck option Use Managed Compatibility Mode
under Tools
-->Options
-->Debugging
-->General
Upvotes: 1