title: Static class method persistence in ASP.NET and IIS app pool
body: <p>Would this static class method be called only once when IIS application starts when used in the context of an ASP.NET web app?</p>
  
  <pre><code>public static class Licensing
  {
      public static bool IsThisLicensed(ThisFeature)
      {
         return Licenser.FeatureEnabled(ThisFeature);
      }
  }
  </code></pre>
  
  <p>We have a case wherein a call similar to this returns True (as it should) for a period of time and then subsequently returns false until IIS is restarted.  Upon restart of IIS the value returns True again.  That said, the timing of this behavior is not predictable.</p>
  
  <p>We can't figure out why the value changes without a restart of IIS or recycle of the app pool.  Our expectation was that this static method would be called once when the application is started and the value would be available application wide until the app was restarted.</p>
  
  <p>I think this is similar to a <a href="https://stackoverflow.com/questions/194999/are-static-class-instances-unique-to-a-request-or-a-server-in-asp-net">previous post</a>:
  but in this case we are working with a call to a method as opposed to a property.</p>