【发布时间】:2012-07-22 10:49:48
【问题描述】:
最近,我们的 .Net 客户端 libaray 正在升级以针对 Net 4.0 进行编译。 将目标框架改成4.0后,应用出现编译错误。
在AssemblyInfo.cs:
[assembly: SecurityPermission(SecurityAction.RequestMinimum, Execution = true)]
错误 7 警告为错误:'System.Security.Permissions.SecurityAction.RequestMinimum' 已过时:'"程序集级别的声明性安全性已过时,默认情况下 CLR 不再强制执行。有关详细信息,请参阅 http://go.microsoft.com/fwlink/?LinkID=155570。 "' `
在 .Net 4.0 中,它显示:SecurityAction.RequestMinimum 已过时,我们将所有警告视为错误。
我应该用它做什么? - 只需删除它(这会产生一些意想不到的影响吗?例如在 IIS 中使用 dll 时)或更改为其他值? 我不熟悉.Net,尤其是它的安全机制。
有人可以帮忙吗?感谢您的任何建议和评论:)
【问题讨论】:
标签: c#-4.0 .net .net-security