WCF application - requires "start of application" for http and tcp bindings

I have a WCF application that needs to run application initialization code when the application starts. Currently, the code is in my Application_Start method in the global.asax.cs file:

protected void Application_Start(object sender, EventArgs e) { // Whatever.. } 

However, my WCF application has both http (asp.net) and TCP (netTcpBinding) endpoints, depending on which service is being called. This code will only work for regular http endpoints, not for TCP. I need the application launch code to run regardless of whether the client call was made through tcp or http. What is the best way to do this?

thanks

+6
source share
1 answer

Application_Start is for the HTTP pipeline only. If you need to initialize the agnostic protocol, use the AppInitialize method .

+6
source

Source: https://habr.com/ru/post/905517/


All Articles