title: How to get file path in Entity Framework Seed method without HttpContext (executed from package manager command)
body: <p>In my entity framework Seed method I have the following line to get a file from a different project:</p>
  
  <pre><code> var filePath = new DirectoryInfo(HostingEnvironment.ApplicationPhysicalPath).Parent.FullName + "\\Com.ProjectX\\companies.xls";
  </code></pre>
  
  <p>This works when a HttpContext is available, like when using this action method to trigger it:</p>
  
  <pre><code>public ActionResult About()
      {
          var configuration = new Com.EntityModel.Configuration();
          var migrator = new System.Data.Entity.Migrations.DbMigrator(configuration);
          migrator.Update();
  
          return View();
      }
  </code></pre>
  
  <p>However, it doesn't work when I execute <code>Update-Database</code> from the package manager console (the file isn't found and it's hard to debug because I also can't breakpoint when doing that. </p>
  
  <p>I'd like to be able to use Update-Database command and have it work without an HttpContext. How can I get the path?</p>