title: Exception "Attempt by security transparent method 'NPOI.OpenXml4Net.OPC.ZipPackage"
body: <p>I am trying to read from an excel file in C# using NPOI. Below is the code snippet I am using to initialize my variables. But while initializing the workbook, below is the exception I am getting. </p>
  
  <pre><code>public class Excelhandler
  {
      public static XSSFWorkbook workbook;
      public static FileStream fileStream;
      static Excelhandler()
      {
          try
          {
              string pth = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
              string actualPath = pth.Substring(0, pth.LastIndexOf("bin"));
              string projectPath = new Uri(actualPath).LocalPath;
              string path = projectPath + @"TestData\Data.xlsx";
              //string path = ConfigurationManager.AppSettings["TestDataPath"];
              fileStream = new FileStream(path, FileMode.Open, FileAccess.Read);
              workbook = new XSSFWorkbook(fileStream);
  
          }
  </code></pre>
  
  <p>The same piece of code was working in some other C# project but  suddenly it's not working. Below are the versions I am using : -</p>
  
  <p>NPOI-2.3.0</p>
  
  <p>SharpZipLib(NPOI Dependency) - 1.0.0</p>
  
  <p>.Net Framework -4.5.2</p>
  
  <p>Exception - Attempt by security transparent method 'NPOI.OpenXml4Net.OPC.ZipPackage..ctor(System.IO.Stream, NPOI.OpenXml4Net.OPC.PackageAccess)' to access security critical method 'ICSharpCode.SharpZipLib.Zip.ZipInputStream..ctor(System.IO.Stream)' failed.</p>