So here's an excerpt from one of my classes:
[ThreadStatic]
readonly static private AccountManager _instance = new AccountManager();
private AccountManager()
{
}
static public AccountManager Instance
{
get { return _instance; }
}
As you can see, it's a singleton-per-thread - i.e. the instance is marked with the ThreadStatic attribute. The instance is also instantiated as part of static construction.
So that being the case, how is it possible that I'm getting a NullReferenceException in my ASP.NET MVC application when I try to use the Instance property?