Is there an event that fires when a WCF service gets started or shut down? Hopefully, independent of whether it is self hosted or hosted in IIS?
ServiceHost exposes quite a few events:
http://msdn.microsoft.com/en-us/library/system.servicemodel.servicehost_events.aspx
You could hook into these events by using a custom service behavior:
http://msdn.microsoft.com/en-us/library/system.servicemodel.description.iservicebehavior.aspx
Sure, the constructor of your object (especially if you are using a Singleton style). Please pardon the shameless self promotion, but I've written two articles on how to get started with a WCF (Net.Tcp) client/server system... The first is non-IIS (to which the service starts on your own terms), the latter is how to modify the first to be hosted in IIS to which my first sentense would apply:
1) Client Server Programming with WCF
2) Duplex WCF Services Hosted in IIS Using Net.Tcp
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With