I have wcf application that is hosted by iis. I add the Global.asax file with implimentation of the Application_Start.
But when i start the iis ( or reset ) i don't see that the Application_Start method is called.
How to fix it ? I want that the iis will call this method on iis start (when the computer startup ( because the iis start automatic on machine start ) or when iis restart )
If the WCF Service is hosted on the IIS on a website, then the Application_Start Method should be called. However, by default application pool wouldn't start until the Application Pool receive the first request.
So, until you make a call to WCF Service, the Application_Start method wouldn't be called.
Also, IIS offer Application Initialization Module, which can be used to issue a Fake Request to the website by the IIS Server so that Application can start Automatically once the IIS Starts. It also allows for custom warm-up code for the Application. You can read more detail here.
WCF doesn't work like that. It's a per-call service and as so handling requests on demand...
A little more details can be found here: https://stackoverflow.com/a/739674/444665
However you might be able to solve your wish through this solution Running a function on WCF start up
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