.NET Core中的模拟System.Security.Permissions

时间:2016-07-14 12:53:01

标签: asp.net-core asp.net-core-mvc .net-core asp.net-core-1.0

我正在尝试将项目移植到.NET Core,但无法找到模拟System.Security.Permissions。项目使用类似的结构

[PermissionSetAttribute(SecurityAction.LinkDemand, Name = "FullTrust")] or [EnvironmentPermission(SecurityAction.LinkDemand, Unrestricted = true)], ''

1 个答案:

答案 0 :(得分:4)

Code Access Security isn't and won't be available in .Net Core.由于所有代码都在完全信任下有效运行,因此删除这些属性就足够了。

如果您确实想限制某些代码,建议是:

  

使用操作系统提供的安全边界,例如用户帐户用于运行具有最少权限集的进程。