每次启动解决方案时都会终止网络服务
当我的应用程序在 VS2010 中启动时,我有 5 个服务正在运行。每次我收到此错误时:
错误 24 无法复制文件“C:\My Project\Main\Entities\bin\Debug\Test.Testing.dll”到 “bin\Test.Testing.dll”。该进程无法访问该文件 'bin\Test.Testing.dll',因为它正在被另一个进程使用。
错误 26 无法复制文件“C:\My Project\Main\Entities\bin\Debug\Test.Testing1.dll”到 “bin\Test.Testing1.dll”。该进程无法访问该文件 'bin\Test.Testing1.dll',因为它正在被另一个进程使用。
错误 23 无法复制文件“C:\My Project\Main\Entities\bin\Debug\Test.Testing2.dll”到 “bin\Test.Testing2.dll”。该进程无法访问该文件 'bin\Test.Testing2.dll',因为它正在被另一个进程使用。
错误 25 无法复制文件“C:\My Project\Main\Entities\bin\Debug\Test.Testing3.dll”到 “bin\Test.Testing3.dll”。该进程无法访问该文件 'bin\Test.Testing3.dll',因为它正在被另一个进程使用。
错误 27 无法复制文件“C:\My Project\Main\Entities\bin\Debug\Test.Testing4.dll”到 “bin\Test.Testing4.dll”。该进程无法访问该文件 'bin\Test.Testing4.dll',因为它正在被另一个进程使用。
要终止这些 Web 服务,我必须创建一个“bat”文件: taskkill /F /IM WebDev.WebServer40.EXE
有谁知道为什么会发生这种情况。似乎每当我关闭应用程序时我的网络服务都不会停止?
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 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想我知道你在说什么。
转到 WCF 库项目属性、WCF 选项选项卡,然后取消选中“在同一解决方案中调试另一个项目时启动 WCF 服务主机”复选框。
如果需要,可以编写基于控制台的主机并从不同的解决方案运行它们(至少我就是这么做的),而不是使用此服务主机。
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).
当您停止 Visual Studio 时,VS Web 服务器不会停止运行。您是否正在启动任何单独的线程?如果将调试器附加到 WebDev.WebServer40.EXE 进程,您应该能够识别哪些代码仍在执行。
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.