开发者

Killing webservices everytime I start my solution

开发者 https://www.devze.com 2023-04-01 18:40 出处:网络
I have 5 services running when my application starts up in VS2010. And everytime I get this error: Error 24Unable to copy file "C:\\My

I have 5 services running when my application starts up in VS2010. And everytime I get this error:

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.

To kill these web services I have to开发者_JAVA百科 create a 'bat' file: taskkill /F /IM WebDev.WebServer40.EXE

Does anyone has any idea why this happens. Seems like my web services dont stop whenever I close the application?


I think I know what you are talking about. Go to WCF Library Project properties, WCF options tab and uncheck the checkbox saying "Start WCF Service Host when debugging another project in the same solution".

Instead of this service host, if required, write console based hosts and run them from a different solution (at least thats what I did).


The VS web server doesn't stop running when you stop Visual Studio. Are you firing off any separate threads? If you attach the debugger to the WebDev.WebServer40.EXE process you should be able to identify what code is still executing.

0

精彩评论

暂无评论...
验证码 换一张
取 消