title: Using Postal and Hangfire in Subsite
body: <p>I have been trying to use Postal on my MVC5 site.  When I host my webpage a subsite ie, <a href="http://localhost/Subsite" rel="nofollow">http://localhost/Subsite</a> I am receiving the error </p>
  
  <ul>
  <li>The virtual path '/' maps to another application, which is not allowed</li>
  </ul>
  
  <p>I have debugged it down to when the ControllerContext is being created the HttpContext isn't getting set correctly. Since I'm running Postal from Hangfire the HttpContext.Current is always null.  Postal creates the ContollerContext using the code below.</p>
  
  <pre><code>        ControllerContext CreateControllerContext()
      {
          // A dummy HttpContextBase that is enough to allow the view to be rendered.
          var httpContext = new HttpContextWrapper(
              new HttpContext(
                  new HttpRequest("", UrlRoot(), ""),
                  new HttpResponse(TextWriter.Null)
              )
          );
          var routeData = new RouteData();
          routeData.Values["controller"] = EmailViewDirectoryName;
          var requestContext = new RequestContext(httpContext, routeData);
          var stubController = new StubController();
          var controllerContext = new ControllerContext(requestContext, stubController);
          stubController.ControllerContext = controllerContext;
          return controllerContext;
      }
  
      string UrlRoot()
      {
          var httpContext = HttpContext.Current;
          if (httpContext == null)
          {
              return "http://localhost";
          }
  
          return httpContext.Request.Url.GetLeftPart(UriPartial.Authority) +
                 httpContext.Request.ApplicationPath;
      }
  </code></pre>
  
  <p>How can I specify the UrlRoot so that instead of pulling the default of localhost to pull it based on my subsite?</p>