我正在将项目从 .Net Framework 移植到 .Net Standard。它广泛使用 SecurityIdentifier
类来表示身份和验证标识符。我已经得到要编译的代码,它在 Windows 上运行良好,但是当我在 Linux 上运行 .Net Core 时,SecurityIdentifier(String)
构造函数抛出一个 PlatformNotSupportedException
。我检查 the source果然它使用导入的 native 函数来解析。这不是一个破坏交易的因素,因为我看到 SecurityIdentifier(byte[], int)
构造函数不依赖于平台功能,并且解析 sid 也不是太难。但是当我在 Linux 上运行它时,我很惊讶地看到构造函数抛出相同的 PlatformNotSupportedException
!
有人在 Linux 上成功使用过这个类吗?您使用的是什么版本的 .Net Core?为什么链接中的源代码与我看到的不匹配?
最佳答案
当 Microsoft announced the Windows Compatibility Pack for .NET Core ,很明显,与 System.DirectoryServices
相关的任何内容都仅限于 Windows。如果您从未订阅过此类新闻 channel ,现在就应该订阅。
还有.NET API Analyzer提前告知此类情况。
https://stackoverflow.com/questions/58868724/
相关文章:
reactjs - react Apollo 测试 : MockProvider takes a l
ios - SwiftUI:ScrollView 偏移滚动内容
npm - [错误 : Unspecified GSS failure. 次要代码可能提供更多信息:
python - Jupyterhub-错误 :asyncio:Task exception was
php - 权限被拒绝 : copy/writing file (laravel/php)
django - 重定向到 Django Admin 中的过滤列表
typescript - 如何在 Visual Studio CE 2019 中使用#region/