title: Error message 'System.Security.VerificationException : Operation could destabilize the runtime.' while extracting text from pdf using iText7
body: <p>I am trying to extract text from .pdf files using iText7.
  It was running fine few days ago but now following error is coming.</p>
  
  <blockquote>
    <p>System.TypeInitializationException : The type initializer for 'Common.Logging.LogManager' threw an exception.
    ----> System.Security.VerificationException : Operation could destabilize the runtime.</p>
  </blockquote>
  
  <p>on local machine code is running fine issue is coming on server.</p>
  
  <p>I have tried updating iText7 package from Manage Nuget Packages</p>
  
  <p>Following is the code I am using to extract text from PDF</p>
  
  <pre><code>public static string ExtractTextFromPDF(string LocationWithFileName)
          {
              StringBuilder PDFText = new StringBuilder();
              PdfDocument pdfDocument = new PdfDocument(new PdfReader(LocationWithFileName));
              LocationTextExtractionStrategy strategy = new LocationTextExtractionStrategy();
              for (int i = 1; i &lt;= pdfDocument.GetNumberOfPages(); ++i)
              {
                  PdfPage page = pdfDocument.GetPage(i);
                  PDFText.Append(PdfTextExtractor.GetTextFromPage(page, strategy));
              }
              pdfDocument.Close();
              return PDFText.ToString();
          }
  </code></pre>