c# - 在 IIS 上回收 WCF Web 服务

标签 c# .net wcf iis

是否可以从代码中回收托管在 IIS 上的 WCF Web 服务?

当从我正在使用的 Oracle 连接收到某个错误代码时,我想回收 Web 服务。

最佳答案

如果您只想回收当前的应用程序,请尝试

HttpRuntime.UnloadAppDomain();

它将从主机内存中卸载您的应用程序,并在下一次请求时再次加载。

来自 MSDN

UnloadAppDomain is useful for servers that have a large number of applications that infrequently receive requests. Rather than keep application resources alive for the lifetime of the process, UnloadAppDomain allows programmatic shutdown of unused applications.

关于c# - 在 IIS 上回收 WCF Web 服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8816983/

相关文章:

wcf - 在 WCF (MSMQ) 服务中禁用 DTC

c# - 在 ASP.NET 中单击按钮获取 Gridview 隐藏字段值

.net - 如何检测.NET中的跨线程访问(强制线程关联)?

.net - 如何在不使用任何外部工具的情况下下载带有批处理文件的文件?

c# - 使用 linq C# 从数据表中查找 "false"的编号

.net - 如何在传输级别压缩来自 WCF .NET 的 HTTP 请求?

c# - WPF中是否有 "All Children loaded"事件

c# - 查询 List<T> 时出现 OleDb 未处理的异常

c# - 我怎样才能制作一个按钮,将剪贴板上的内容粘贴到任何位置?

c# - WCF nettcp 回调在部署时不起作用