G
Guest
I have an asp.net 2.0 web application where some of the processing has been
delegated to a background worker thread. The code for that thread is in a VB
module that is part of the application, but is not a code-behind. I would
like to read/write values in the application object's cache, but can't find a
way to get to it. The background thread is part of the web app, but it does
not run in the context of an http request. So when I try:
Dim app As HttpApplication = HttpContext.Current.ApplicationInstance
Dim appcache As HttpApplicationState = app.Application
appcache.Add("v1", 1)
I get an exception on the first line because "Current' is set to nothing.
Any suggestions appreciated-
Mike
delegated to a background worker thread. The code for that thread is in a VB
module that is part of the application, but is not a code-behind. I would
like to read/write values in the application object's cache, but can't find a
way to get to it. The background thread is part of the web app, but it does
not run in the context of an http request. So when I try:
Dim app As HttpApplication = HttpContext.Current.ApplicationInstance
Dim appcache As HttpApplicationState = app.Application
appcache.Add("v1", 1)
I get an exception on the first line because "Current' is set to nothing.
Any suggestions appreciated-
Mike