I have a WCF application that requires some app initialization code to fire when the app starts. Currently the code sits in my Application_Start method in global.asax.cs:
protected void Application_Start(object sender, EventArgs e)
{
// Whatever..
}
However, my WCF app has both http (asp.net) and TCP (netTcpBinding) endpoints, depending on what service is being called. This code will only fire for normal http endpoints, not TCP. I need the app start code to fire regardless of whether a client call was made via tcp or http. What's the best way to do this?
Thanks
Application_Start
is only for HTTP pipeline. If you need protocol agnostic initialization use AppInitialize method.
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