I have WCF service that is hosted in IIS.
I need to initialize once several things that will exists through all calls to the services.
Where is the appropriate place to make those initializations ?
Thanks for assistance .
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use constructor (either that of BaseService or actual service class) to initialize these properties
Bear in mind that when WCF service is configured for Per-Call instance mode, Service instance will be created for each client request
If is not strictly needed don’t use any Singleton strategy:
Singleton WCF services should hardly ever be used- Singletons are the enemy of scalability! They only make sense in weird scenarios- logging to a single file, a single communications port or hardware device.