title: .Net Standard 2.0 with .Net Framework 4.8 - Could not load file or assembly System.Security.Principal.Windows, Version=4.1.1.0
body: <p>I'm working on an ASP application written in .Net Framework 4.8, running on IIS on Windows Server 2012 R2. I've created a NuGet package, which is a .Net Standard 2.0 library and it all runs happily on my local machine through Visual Studio debugging.</p>
  <p>Having deployed it to the server (replaced the existing bin folder with the new one, including all the new files) I am now getting this error.</p>
  <pre><code>Could not load file or assembly 'System.Security.Principal.Windows, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
  </code></pre>
  <p>I'm running the most up to date version of the MS Build Tools, the latest Windows updates available for the server, and both the .Net Framework application and the .Net Standard library are using version 5 of System.Security.Principal.Windows, despite what this error message says.</p>
  <p>I have ensured that all the Windows features related to IIS are enabled on the server as they are on my development machine. I have rebuilt both the application and the library. I have totally uninstalled and reinstalled the System.Security.Principal.Windows NuGet package from both. I have tried setting this in the csproj file for the application:</p>
  <pre><code>&lt;AutoGenerateBindingRedirects&gt;true&lt;/AutoGenerateBindingRedirects&gt;
  &lt;GenerateBindingRedirectsOutputType&gt;true&lt;/GenerateBindingRedirectsOutputType
  </code></pre>
  <p>I have tried setting this in the csproj too:</p>
  <pre><code>&lt;PropertyGroup&gt;
      &lt;!--- ... --&gt;
      &lt;RestoreProjectStyle&gt;PackageReference&lt;/RestoreProjectStyle&gt;
      &lt;!--- ... --&gt;
  &lt;/PropertyGroup&gt;  
  </code></pre>
  <p>So far nothing has worked. I'm unclear on why this is even an issue, given it has worked flawlessly on my local machine.</p>
  <p>Any suggestions? The solutions given for other similar issues on Stack Overflow have not worked for me.</p>