Reputation: 8449
I have a service which has a long initialization process.
If I do the initialization in the constructor, even calls that just need to read the wsdl will take very long.
Doing the initialization during the first call to the service will make this call take to long.
Are there other alternatives? Is it possible to trigger an asynchronous initialization in the constructor?
Upvotes: 1
Views: 180
Reputation: 1894
If you host your service in IIS you could install Windows Server AppFabric, is an extension designed to provide additional configuration options like monitoring, instrumentation, logging and persistence workflow.
Another usefull feature for WCF is the capability to auto-start services without waiting for the first client request, without AppFabric the WAS launches your hosting process only when the first client request comes in. This is quite importat in a singleton scenario like yours
http://msdn.microsoft.com/en-us/windowsserver/ee695849.aspx
Upvotes: 2