是否可以从代码中回收托管在 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/