1

I have a server software that is written in C#. Sometimes I take this error:

Unable to copy file "obj\x86\Debug\Server.exe" to "bin\Debug\Server.exe". The process cannot access the file 'bin\Debug\Server.exe' because it is being used by another process.

How can I understand that my program is still running in background and stop that?

Michał Powaga
  • 22,561
  • 8
  • 51
  • 62
sanchop22
  • 2,729
  • 12
  • 43
  • 66
  • I want to realize that with my software, not windows task manager. – sanchop22 Apr 13 '12 at 08:43
  • 2
    If I understand this right you get this error while compiling. You code is not even running now to see, if another instance of it is running. – Ramesh Apr 13 '12 at 08:45

1 Answers1

4

This is most probably caused not by your software (the one you are writing), but by IDE itself.

I usually just use Task Manager to kill whatever vshost process is still hanging, but that may not be very safe. Or sometimes all it takes is to restart Visual Studio.

Tschareck
  • 4,071
  • 9
  • 47
  • 74