2011-08-31 68 views
1

當我的應用程序在VS2010中啓動時,我有5個服務正在運行。每次我得到這個錯誤:每次我開始我的解決方案時都會終止web服務

Error 24 Unable to copy file "C:\My Project\Main\Entities\bin\Debug\Test.Testing.dll" to "bin\Test.Testing.dll". The process cannot access the file 'bin\Test.Testing.dll' because it is being used by another process.

Error 26 Unable to copy file "C:\My Project\Main\Entities\bin\Debug\Test.Testing1.dll" to "bin\Test.Testing1.dll". The process cannot access the file 'bin\Test.Testing1.dll' because it is being used by another process.

Error 23 Unable to copy file "C:\My Project\Main\Entities\bin\Debug\Test.Testing2.dll" to "bin\Test.Testing2.dll". The process cannot access the file 'bin\Test.Testing2.dll' because it is being used by another process.

Error 25 Unable to copy file "C:\My Project\Main\Entities\bin\Debug\Test.Testing3.dll" to "bin\Test.Testing3.dll". The process cannot access the file 'bin\Test.Testing3.dll' because it is being used by another process.

Error 27 Unable to copy file "C:\My Project\Main\Entities\bin\Debug\Test.Testing4.dll" to "bin\Test.Testing4.dll". The process cannot access the file 'bin\Test.Testing4.dll' because it is being used by another process.

要殺死這些Web服務我要創建一個「蝙蝠」文件:taskkill /F /IM WebDev.WebServer40.EXE

沒有人有爲什麼發生這種情況的任何想法。似乎我的Web服務不會停止,只要我關閉應用程序?

+0

如何關閉應用程序?嘗試在Visual Studio中單擊「停止調試」。 –

+0

我做到了。但服務仍在我的本地主機上運行。 –

+0

因此,從乾淨的開始,你按F5,按「停止調試」,再次按F5,第二次,你在建立服務時出錯。 –

回答

1

我想我知道你在說什麼。 轉到WCF庫項目屬性,WCF選項選項卡,並取消選中「在同一解決方案中調試另一個項目時啓動WCF服務主機」複選框。

而不是這個服務主機,如果需要,編寫基於控制檯的主機,並從不同的解決方案運行它們(至少這就是我所做的)。

+0

謝謝Pkay。這工作... –

0

當您停止Visual Studio時,VS Web服務器不會停止運行。你是否解僱了任何單獨的線程?如果您將調試器附加到WebDev.WebServer40.EXE進程,您應該能夠識別哪些代碼仍在執行。

+0

是的。我已將我的調試器附加到WebDev.WebServer40.EXE。 –

相關問題