3

I've been debugging in VS.NET 2010 without issue. But now cannot build. I get the error:

Unable to copy file [filename] to bin\Debug\[filename].  The process cannot access the file bin\Debug\[filename] because it is being used by another process.

I get this error for six different files. I've restart VS.NET 2010 but still get the error. Without restarting the machine, does anyone know how to resolve this?

4thSpace
  • 43,672
  • 97
  • 296
  • 475

6 Answers6

5

There are a bunch of questions on SO related to this, all with suggestions and recommendations for solving the issue. For me, none worked until I found this one.

In short, if it's the System Process locking the file, and you have the Application Experience service stopped, restart it. Seriously.

Community
  • 1
  • 1
Eight-Bit Guru
  • 9,756
  • 2
  • 48
  • 62
  • Thanks. From that post, I tried compmgmt.msc -> System Tools -> Shared Folders -> Open Files but nothing there. This is a Windows Service project and the service had already been stopped. But I did see the EXE was still running. I killed it and all is well. – 4thSpace Oct 02 '13 at 16:10
3

the exe's you are compiling and debugging are still running even after you stop debugging. Kill those exe's from task manager and then compile your exe's. After this, compiling would work perfectly.

Deepansh Gupta
  • 593
  • 4
  • 9
0

Use unlocker tool to identify which process is locking up the file. THen unlock it using the same unlocker tool.

ckv
  • 10,539
  • 20
  • 100
  • 144
0

Are you running the program you've built? It may be locking files in the Debug dir.

cja
  • 9,512
  • 21
  • 75
  • 129
0

Try to kill it via Task Manager. If it cannot be closed either. Use tool 'Process Explorer' to check which file is holding this process, and kill the holder process first.

Elliot Chen
  • 378
  • 2
  • 9
0

For windows 10 users,follow the steps to locate the "Application Experience Server" and click on run button. That's it.

  1. Go to the search in start menu and type task scheduler and select it from the list of results.
  2. In there, please select the Task scheduler library in the left pane.
  3. There select Microsoft.
  4. In Microsoft, please select Windows.
  5. In the Windows, please select the Application Experience.
mcfred
  • 1,183
  • 2
  • 29
  • 68