title: Security execution when trying to use pplus in Asp.net application
body: <p>I'm trying to use EPPlus in Asp.net application And I'm getting this exception:</p>
  <pre><code>Attempt by security transparent method 'OfficeOpenXml.ExcelPackage.Init()' to access security critical method 'System.Text.CodePagesEncodingProvider.get_Instance()' failed. 
  System.MethodAccessException: Attempt by security transparent method 'OfficeOpenXml.ExcelPackage.Init()' to access security critical method 'System.Text.CodePagesEncodingProvider.get_Instance()' failed. Assembly 'EPPlus, Version=5.7.5.0, Culture=neutral, PublicKeyToken=ea159fdaa78159a1' is marked with the AllowPartiallyTrustedCallersAttribute, and uses the level 2 security transparency model. 
  Level 2 transparency causes all methods in AllowPartiallyTrustedCallers assemblies to become security transparent by default, which may be the cause of this exception. at 
  OfficeOpenXml.ExcelPackage.Init() at OfficeOpenXml.ExcelPackage..ctor() at 
  Utilities.Database.EPPlus.EPPlusHelpers.WriteToExcel(DataColumn[] columns, IEnumerable`1 data, Stream output, String worksheetName, ColumnFormatProvider formatProvider) at 
  WebClient.Reports.ReportsPane2.&lt;&gt;c__DisplayClass60_0.b__0(String tempFilename) at
  Utilities.WebUI.Utils.ReturnGeneratedFile(Boolean returnInResponse, String tempPath, String 
  filename, String contentType, Encoding encoding, Action`1 fileGenerator) at
  WebClient.Reports.ReportsPane2.ReportToExcel(Int32 controllerID, IEnumerable`1 dataPoints, Dictionary`2 displayInfo, Boolean displayDiscreteValues) at
  WebClient.Reports.ReportsPane2.ReportDirectExport(ReportDefinition reportDef, ExportFormat exportFormat)
  </code></pre>
  <p>The Asp.net application is a .NET Framework 4.7.2 which references a .NET Standard 2.0 library protect which uses EPPlus 5.7.5 NuGet package.</p>
  <p>I've tried adding</p>
  <pre><code>configuration&gt;
      &lt;system.web&gt;
         &lt;trust level=&quot;Full&quot; /&gt;
      &lt;/system.web&gt;
  &lt;/configuration&gt;
  </code></pre>
  <p>to the <code>web.config</code>, but it did not work.</p>
  <p>The previous version of the application used .NET Framework 4.6
  with a .NET Framework library project which referenced EPPlus 4.5.1 NuGet package, that worked ok.</p>