Tuesday, August 29, 2006

The answer is that in ASP.NET, static variables should be used instead of the Application object. It's something that I had never considered in terms of best practice, until I was asked this week. After a little digging on MSDN I came across the guidelines which state:

  • Use static properties instead of the Application object to store application state.
  • Use application state to share static, read-only data.
  • Do not store STA COM objects in application state.

It comes down to the fact that the Application object is included for compatibility with classic ASP which had no application runtime like .NET.

You learn something new every day! More info can be found in the Knowledge Base article 312607.

Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):