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.
我有一个初始化过程很长的服务。
如果我在构造函数中进行初始化,即使只需要读取 wsdl 的调用也会花费很长时间。 在第一次调用服务期间进行初始化将使此调用花费很长时间。
还有其他选择吗?是否可以在构造函数中触发异步初始化?
如果您在 IIS 中托管您的服务,您可以安装 Windows Server AppFabric,这是一个扩展,旨在提供额外的配置选项,如监控、检测、日志记录和持久性工作流。
WCF 的另一个有用功能是无需等待第一个客户端请求即可自动启动服务的能力,如果没有 AppFabric,WAS 仅在第一个客户端请求进入时才启动您的托管进程。这在像您这样的单例场景中非常重要
http://msdn.microsoft.com/en-us/windowsserver/ee695849.aspx