How does one fix the “'System.Security.Permissions.SecurityAction.RequestMinimum' is obsolete” compilation error?

一笑奈何 提交于 2019-12-01 15:07:25

Did you read the full compiler warning or visit the link it includes? The "naked" CLR no longer restricts CAS permissions under .NET 4.0 unless you flip a "legacy mode" switch, so there is no replacement for your RequestMinimum use. The assembly-level SecurityPermissionAttribute should be removed, not modified.

For a more complete explanation of the 4.0 CAS changes than appears on MSDN, see http://blogs.msdn.com/b/shawnfa/archive/2009/05/21/security-policy-in-the-v4-clr.aspx and http://blogs.msdn.com/b/shawnfa/archive/2010/02/24/so-is-cas-dead-in-net-4-or-what.aspx.

http://msdn.microsoft.com/en-us/library/ee471421.aspx

It seems the problem is that assembly level declarative security on the whole has been marked obsolete. Perhaps you can apply this at a method-level instead?

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