title: Is there a .net core 2.2 way of doing WindowsImpersonationContext?
body: <p>This is not working <code>private static WindowsImpersonationContext impersonationContext;</code></p>
  
  <p>I am needing to be able to do this</p>
  
  <pre><code>tempWindowsIdentity = new WindowsIdentity(tokenDuplicate);
  
  impersonationContext = tempWindowsIdentity.Impersonate();
  </code></pre>
  
  <p>And then this</p>
  
  <pre><code>if (impersonationContext != null)
  {
      impersonationContext.Undo();
      impersonationContext = null;
  }
  </code></pre>
  
  <p>I was looking at this question/answer:  <a href="https://stackoverflow.com/questions/46529121/windowsimpersonationcontext-impersonate-not-found-in-asp-core">WindowsImpersonationContext &amp; Impersonate() not found in ASP.Core</a></p>
  
  <p>However that doesn't seem to be a good match, does it? </p>