2

I am trying to find my URL, while i am in a different thread, is it possible ? my code : string url = HttpContext.Current.Request.Url.AbsoluteUri;

the error i am getting is "threw an exception of type nullreference exception"

1 Answers1

3

You cannot access HttpContext.Current unless you set it by passing a reference into your new thread see the answer to this question for more details

Access HttpContext.Current from different threads

Community
  • 1
  • 1
RobPethi
  • 551
  • 9
  • 27