本文介绍了SecurityAction.RequestMinimum是过时的。Net 4.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,我们的.Net客户端libaray正在升级编译针对.NET 4.0。改变目标框架到4.0后,应用程序有一些编译错误。

Recently, our .Net client libaray is upgrading to compile against Net 4.0.After change the target framework to 4.0, the application has some compilation error.

的AssemblyInfo.cs

[总成:的SecurityPermission(SecurityAction.RequestMinimum,执行= TRUE)]

错误7警告的错误:System.Security.Permissions.SecurityAction.RequestMinimum已过时:集结号级别声明性安全是过时的,由CLR默认情况下,不再强制见的获得更多的信息。  `

在.NET 4.0中,它表明: SecurityAction.RequestMinimum 已经过时了,我们把所有的警告当作错误

In .Net 4.0, it shows that: SecurityAction.RequestMinimum as obsolete, and we treat all warning as error.

我应该怎么做呢? - 只是将其删除(将这个已经一些意想不到的影响,例如,当这些DLL在IIS中使用?),或者切换到其他的价值?我不熟悉的.Net,特别是它的安全机制。

What I should do with it? - Just remove it(will this has some unexpected impact? for example when the dlls are used in IIS) or change to some other value?I am not familiar with .Net, especially its security mechanism.

任何人都可以帮助这个吗?感谢您的任何建议和意见:)

Anyone can help on this? Thanks for any advice and comment :)

推荐答案

从MSDN:

在.NET Framework 4版,运行时支持已被删除强制执行拒绝,RequestMinimum,RequestOptional和RequestRefuse权限请求。这些要求不应该在code中使用的是基于.NET框架4或更高版本。

所以,只是将其删除。

这篇关于SecurityAction.RequestMinimum是过时的。Net 4.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 14:53