简体   繁体   English

如何从C#WinForms停止WebService

[英]How to stop a WebService from C# WinForms

If I have 2 startup projects as explained here . 如果我有2个启动项目为解释在这里

One is a WebSite/WebService; 一个是WebSite / WebService;另一个是WebSite / WebService。 the other is a WinForms app. 另一个是WinForms应用。

How do I stop the Service when the C# WinForm app is closed. 关闭C#WinForm应用程序后如何停止服务。

UPDATE 更新

Im running IIS Express within my Solution. 我在解决方案中运行IIS Express。

Ther are the 2 projects (WebSite/WinForms) When the WinForms app closes it must also stop the instance of IISExpress. 这是2个项目(WebSite / WinForms),当WinForms应用程序关闭时,它还必须停止IISExpress的实例。

Im noticing that while debugging, I close the app but the Service is still running. 我注意到在调试时,我关闭了该应用程序,但该服务仍在运行。

I didn't use IIS Express before but I guess it works over a process. 我以前没有使用过IIS Express,但我猜它可以在一个过程中工作。 So probably you will find and kill that process at all. 因此,您可能会发现并杀死该过程。

Checking this link may help. 检查此链接可能会有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM