I'm coming from an ISAPI background and migrating code to Webservices.
In the ISAPI world, there are sections of code that are invoked only once
when the DLL is loaded by IIS. It's a place where you can do time-consuming
resource loading once and only once.
In .NET Webservices, I figured that the section at the bottom of this
message would be called once upon the loading of the Webservice. From that
point on, only the methods exposed in the service would be invoked. At
least that was my theory.
Now perhaps this is a lack of understanding of how the ASPNET services load.
In the ISAPI world, the first time the ISAPI module is invoked it generally
stays in IIS memory until you end or restart IIS services (an option to
"cache ISAPI services". That is for speed in a production environment.
This can be a pain in the butt when you are debugging, since you have to
stop/start IIS every time you compile and link a revision.
In .NET, I notice that I can always rebuild my Webservice without restarting
IIS and perhaps that means ASPNET by default doesn't stay in memory after
invocation.
So my question is this: Is there a similar caching option for ASPNET
services or does that startup code invoke everytime someone hits a
Webmethod?
TIA
Harry
public Service1()
{
InitializeComponent();
}