0

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

enter image description here

I had to restart system to get rid off this error. Can anyone tell why is this happening?

Roberto Caboni
  • 7,252
  • 10
  • 25
  • 39
neelesh bodgal
  • 632
  • 5
  • 14

1 Answers1

1

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

Mr Qian
  • 21,064
  • 1
  • 31
  • 41
  • Thanks Perry. I will try this next time. – neelesh bodgal Jul 22 '20 at 04:59
  • Thanks for your feedback. Actually, you should enter your task manager and check if there is any other process taking up your program and if so, you should shut down it. Besides, I have improved my answer. You can check it when you face it again. – Mr Qian Jul 22 '20 at 06:06
  • Actually I did, but could not find relevant process to end. I tried to kill all cmd.exes but of no avail. – neelesh bodgal Jul 22 '20 at 07:04
  • Hi guy, do the other steps 2,3,4 help you handle this issue? – Mr Qian Jul 22 '20 at 09:58
  • Before posting, actually I restarted the machine. Error went away. So when it occurs I will try all these steps and update here. – neelesh bodgal Jul 22 '20 at 10:57
  • Okay....If you have any problems, please feel free to let us know. We are glad to help you further and we are always here. – Mr Qian Jul 23 '20 at 02:45