1

I am using a threading architecture in my ASP.NET web application. In this application, I have maintained a global application variable that i want to access in a Thread.

How can i get Application state in a Thread?

RAKESH HOLKAR
  • 2,067
  • 5
  • 24
  • 41
Jitender Mahlawat
  • 2,774
  • 3
  • 15
  • 12

1 Answers1

2

HttpContext.Current will be null in subsequent threads. See this question for details: The cross-thread usage of "HttpContext.Current" property and related things

However, you could just pass System.Web.HttpContext to the threads and access Current from each thread.

Community
  • 1
  • 1
Tudor
  • 60,450
  • 12
  • 98
  • 142