2

When trying to build my project I get the error

Error 253 Could not copy "obj\Debug\Intranet.Web.dll" to "bin\Intranet.Web.dll". Exceeded retry count of 10. Failed. Web2

I looked at what process has a lock on the file and its

C:\Program Files (x86)\Common Files\microsoft shared\DevServer\11.0\WebDev.WebServer40.EXE

Whats with this? Is it belongs to visual studio why is it holding onto a binary I am trying to build?

BruteCode
  • 1,143
  • 7
  • 16
  • 22
  • Trying killing the WebDev.WebServer40.EXE process...that's Visual Studio's built-in web server, so it may be holding onto a file it is hosting (even though it shouldn't) – Tim M. Mar 11 '13 at 20:22
  • @TimMedora: Any idea how to kill it in a build step or something? – BruteCode Mar 11 '13 at 20:34
  • Is it locking every time? You definitely don't want to kill it ALL the time, as it's probably hosting the debug version of your website. – Tim M. Mar 11 '13 at 20:38
  • @TIm: about half the time but its pretty much 100% of a few moments so i have to hand kill it during that time – BruteCode Mar 11 '13 at 20:51
  • I assume that you've tried restarting VS, rebooting the machine, and that you aren't somehow locking the file from your code. You can use a pre-build event to execute a [batch file which kills the process](http://stackoverflow.com/questions/33822/any-way-to-write-a-windows-bat-file-to-kill-processes). – Tim M. Mar 11 '13 at 21:51

1 Answers1

0

I had the same thing 100% of the time after the first time debugging. Restarting MSVS every time I wanted to debug worked, but was really annoying, especially with a fairly large solution. Try killing YourProjectName.vshost.exe that is what was locking my files.

Gary
  • 3,254
  • 2
  • 27
  • 30