title: Request.QueryString not recognized, System.Web included in namespace
body: <p>A simple question but I'd rather ask since I had problem with it two times.</p>
  
  <p>I am trying to retrieve hostname from the url in ASP.NET project. The code is actually not in a web page but in a class (part of the domain). System.Web is included in the headers. When I try to use Request.QueryString it is not recognized. Even worse if I try HttpContext.Current, I get this error</p>
  
  <pre><code>'System.Web.HttpContext.Current' is null
  </code></pre>
  
  <p>Here is my code</p>
  
  <pre><code>using System.Web;
  
  public class MyNightlyJob : AbstractJob
  {
      public override void ExecuteJob(IJobExecutionContext context)
      {
            HttpContext.Current.Request.ServerVariables["HTTP_HOST"]; // does not work
            Request.ServerVariables["HTTP_HOST"]; // this does not work also
      }
  }
  </code></pre>
  
  <p>What am I missing? Note that my question is actually about Request.ServerVariables but if one works, the other will work too. </p>
  
  <p>Note that Request.ServerVariable is not recognized in the code at all. HttpContext.Current is recognized but I get run time error for that.</p>