首页 > 解决方案 > System.IO.FileSystem.AccessControl assembly not found in .NET Core 3.0

问题描述

System.IO.FileSystem.AccessControl assembly not found in .NET Core 3.0.

I am trying to create user in LDAP and when calling CommitChanges, I get this error

Could not load assembly.

标签: azureazure-functionsasp.net-core-3.1

解决方案


System.IO.FileSystem.AccessControl支持到 .NETCore 2.0。

该类 FileSecurity 现在是 .NET Core 的 System.IO.FileSystem.AccessControl 包的一部分。

不再有 File.GetAccessControlorFile.SetAccessControl方法,因此您需要 FileSecurity 自己实例化实例。

您必须将其添加System.IO.FileSystem.AccessControl为 NuGet 包。

CommitChanges 所需的命名空间是

System.DirectoryServices

请参考Nuget PackagesPackageReference


推荐阅读