The presence of code below in VisualStudio 2017. The .NET Core 2.0 Console Application
using System;
using System.Security.Principal;
namespace smallTests
{
class Program
{
static void Main(string[] args)
{
var identity = WindowsIdentity.GetCurrent();
}
}
}
Why am I getting the error:
The name 'WindowsIdentity' does not exist in the current context
If I see this class in the .NET Core 2.0 library in .NET Core docs ?
The same code works in the .NET Console application.
[EDIT]
@Will @JohnnyL Comments that I am not referring System.Security.Principal.Windows.dll
, it is true.
But I am curious why it does not work, because in the .NET 4.6.1 project (where the WindowsIdentity class is visible) I also do not refer to this one System.Security.Principal.Windows.dll
in particular. However, I refer to System.dll.
I always thought that it works like a namespace hierarchy. For example, when I refer to
System.Security.Principal.dll
I can use a class that is in
System.Security.Principal.Windows.dll
.
I am wrong?
System.Security.Principal.dll
.NetCore , - .
[EDIT2]
@Will , .
, WindowsIdentity Core, , , , :
apisof.net Declarations , WindowsIdentity .Net Core 2.0 System.Security.Principal.Windows, Version=4.1.1.0, PublicKeyToken=b03f5f7f11d50a3a
System.Security.Principal.Windows.dll
, ? , ?
. NET Core api ( , ?
?