title: Initialize a class in BeforeTestRun hook and use it in BeforeScenario
body: <p>I am using extent Reports in my specflow unit tests.
  I have 2 projects in 1 solution. I have a separate project for creating a hook file which will be common for both the projects.
  I need to initialize my extentreports object in <code>BeforeTestRun</code> hook and use it in <code>BeforeScenario</code>.
  I am not getting a way to access the same.
  Here is my code so far :</p>
  
  <pre><code> public static void BeforeFeature()
      {
          extentReports = new ExtentReports();
  
          htmlReporter = new ExtentHtmlReporter(FeatureContext.Current.FeatureInfo.Title + ".html");
  
          htmlReporter.Configuration().Theme = Theme.Dark;
  
          extentReports.AttachReporter(htmlReporter);
          TestcaseConst._logger = LogManager.GetCurrentClassLogger();
  
          FeatureContext.Current.Set&lt;ExtentReports&gt;(extentReports);
      }
  
      [BeforeScenario]
      public static void BeforeScenario()
      {
          extentTest = FeatureContext.Current.Get&lt;ExtentReports&gt;().CreateTest(ScenarioContext.Current.ScenarioInfo.Title, "This test is to check the status of API under test");
          ScenarioContext.Current.Set&lt;ExtentTest&gt;(extentTest);
      }
  </code></pre>
  
  <p>Now, I need to shift this code under BeforeFeature to BeforeTestRun, but I am not getting to save something like this   "FeatureContext.Current.Set(extentReports);" in BeforeTestRun.</p>
  
  <p>Please help if anyone knows.
  Thanks In Advance.</p>