本帖最后由 喵星来的喵 于 2021-7-5 17:40 编辑
想要创建一个服务端WebAPI实现读取和修改文件夹权限,但是发现.NetCore 3.1不支持.NetFramework 4.7.2的System.IO.DirectoryInfo.GetAccessControl() 方法,请问有其他替代方法可用吗?或者其他可行的方法?
以下是报错信息:
{
"ClassName": "System.MissingMethodException",
"Message": "Method not found: 'System.Security.AccessControl.DirectorySecurity System.IO.DirectoryInfo.GetAccessControl()'.",
"Data": {
"$type": "System.Collections.ListDictionaryInternal, System.Private.CoreLib",
"App Name": "YKD0ANWDPZ2AWERG5J4AGB5H1F1RLVBT",
"App Version": "7.0.3.0",
"Timestamp of the exe": "5f8de6f1",
"Assembly Name": "System.Private.CoreLib",
"Version of faulting assembly": "4.700.20.36602",
"Timestamp of faulting module": "88a5ea35",
"MethodDef": "366a",
"IL Offset of faulting instruction": "2d",
"Exception Type": "System.MissingMethodException",
"NIL": ""
},
"InnerException": null,
"HelpURL": null,
"StackTraceString": " at SMT_HZG_API.MyAPI.SetFolderPermission()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at SMT_HZG_API.MyAPI.SetFolderPermission()",
"RemoteStackTraceString": null,
"RemoteStackIndex": 0,
"ExceptionMethod": null,
"HResult": -2146233069,
"Source": "SMT_HZG_API",
"WatsonBuckets": null,
"MMClassName": null,
"MMMemberName": null,
"MMSignature": null
}
|