简体   繁体   中英

SecurityIdentifier not supported on .Net Core Linux?

I'm in the process of porting a project from.Net Framework to.Net Standard. It makes extensive use of the SecurityIdentifier class to represent identities and to validate identifiers. I've gotten the code to compile and it runs fine on Windows, but when I run.Net Core on Linux the SecurityIdentifier(String) constructor throws a PlatformNotSupportedException . I check the source and sure enough it uses imported native functions to parse. That's not a deal-breaker since I see that the SecurityIdentifier(byte[], int) constructor doesn't rely on platform functionality, and parsing a sid isn't too hard. But when I run it on Linux, I'm surprised to see that constructor throw the same PlatformNotSupportedException !

Has anyone successfully used this class on Linux? What version of.Net Core were you using? Why does the source code in the link not match what I'm seeing?

When Microsoft announced the Windows Compatibility Pack for .NET Core , it was made very clear that anything related to System.DirectoryServices is Windows only. If you never subscribed to such channels for news, you should now.

There is also .NET API Analyzer to tell such cases in advance.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM