Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有 WCF,我的应用程序通过 net.TCP 连接到这个 WCF。有没有办法在 WCF 即将销毁或 IIS 重新启动时通知?我有回调:ServerGoingDown,并且想在 WCF 即将销毁或 IIS 重新启动/停止时调用它。
WCF 构建在 ASP.NET 之上,因此您应该能够将文件添加到您的项目并从全局事件中Global.asax调用您的清理方法。Application_OnStop
Global.asax
Application_OnStop