Accessing the ASP.NET Cache from a Separate Thread?

前端 未结 2 1679
时光取名叫无心
时光取名叫无心 2021-01-17 11:08

Normally i have a static class that reads and writes to HttpContext.Current.Cache

However since adding threading to my project, the threads all get null

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-17 11:47

    If your project is an ASP.NET project, then it was multithreaded even before you "added threading".

    Check to see if HttpContext.Current is non-null before referencing HttpContext.Current.Cache.

    Also, please post the complete exception you're receiving, and show us the code that references the cache.

提交回复
热议问题