0

In a Mvc WebApp I am stuck at this line in a controller:

WindowsImpersonationContext impersonationContext = WindowsIdentity.GetCurrent().Impersonate();

VS 2015 Community complaints about WindowsImpersonationContext which is not defined in DNX 5 (but it is correctly referenced by DNX 4.5.1 in the same project). I added System.Security inside DNX 4.5.1 References but there are no assemblies available for DNX 5.

I do understand DNX is becoming a multiplatform runtime, but now how do I implement a Windows Identity impersonation in my project? TIA

[update] There is a closed issue on github's DNX Core repository: #4533 but it is marked as RC2. Maybe shall wait for the next release.

Lookaji
  • 1,023
  • 10
  • 21
  • How can it be multiplatform if Windows Identity impersonation is platform specific? :P – Tseng Mar 12 '16 at 15:35
  • Actually I am using Visual Studio 2015 on a windows system. If you create a new WebApplication project and try to use impersonation (declared in `System.Security.Principal`), looks like `System.Security` is not recognized by DNX5 resulting in a compile error. Looks there is an issue in github [System.Net.Security doesn't support coreclr](https://github.com/dotnet/corefx/issues/4533). – Lookaji Mar 12 '16 at 15:47

0 Answers0