.NET Core中的Analog System.Security.Permissions [英] Analog System.Security.Permissions in .NET Core

查看:147
本文介绍了.NET Core中的Analog System.Security.Permissions的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将项目移植到.NET Core,但是找不到模拟的System.Security.Permissions。项目使用这样的构造

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)]或
[EnvironmentPermission(SecurityAction。 LinkDemand,Unrestricted = true)]

''

推荐答案

代码访问安全性并没有赢得在.Net Core中不可用。由于所有代码都在完全信任的情况下有效运行,因此删除这些属性就足够了。

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.

这篇关于.NET Core中的Analog System.Security.Permissions的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆