dotnet-api-docs icon indicating copy to clipboard operation
dotnet-api-docs copied to clipboard

`WindowsIdentity` references .NET Framework code and has bad example code

Open ppena-LiveData opened this issue 11 months ago • 1 comments

Type of issue

Code doesn't work

Description

The .NET CoreWindowsIdentity documentation has various places that link to the .NET Framework WindowsImpersonationContext class that does not exist in .NET Core, and the example code is copied verbatim from the .NET Framework version of WindowsIdentity's doc, which would not work or even compile, since it references an Impersonate() method, which as far as I can tell is only in the .NET Framework version of WindowsIdentity, not in the .NET Core version of it.

Page URL

https://learn.microsoft.com/en-us/dotnet/api/system.security.principal.windowsidentity?view=net-8.0

Content source URL

https://github.com/dotnet/dotnet-api-docs/blob/main/xml/System.Security.Principal/WindowsIdentity.xml

Document Version Independent Id

b7498a9d-cecb-02e5-9865-e690bbaa9225

Article author

@dotnet-bot

ppena-LiveData avatar Feb 07 '25 20:02 ppena-LiveData

Tagging subscribers to this area: @dotnet/area-system-security, @vcsjones