Analog System.Security.Permissions in .NET Core

早过忘川 提交于 2019-12-11 05:21:01

问题


I am trying to port project to .NET Core, but can't find analog System.Security.Permissions. Project uses construction like that

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


回答1:


Code Access Security isn't and won't be available in .Net Core. Since all code is effectively running under full trust, it should be enough to remove those attributes.

If you actually want to restrict some code, the recommendation is:

Use operating system provided security boundaries, such as user accounts for running processes with the least set of privileges.



来源:https://stackoverflow.com/questions/38374796/analog-system-security-permissions-in-net-core

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!