views:

552

answers:

2

I am trying to access the Cache in the Application_Start method of Global.asax. I am trying to accdess Context.Cache. When I run the code from visual studio it works just fine but when I run it on the server from IIS I get: Session state is not available in this context. I want to seed some values in the cache when the application starts. How can I get at the cache from Application_Start?

+4  A: 

Wow. I found the answer to this. Use the variable HttpRuntime.Cache instead of Context.Cache.

minty
+1  A: 

Thanks for the answer @minty. You saved the day!!

mishrsud