ASP.NET 4.0 中的信任级别是否已过时?
Microsoft 在 .NET 4.0 及更高版本上引入了新的安全模型,它取代了代码访问安全性。 由于信任级别是代码访问安全性,这种方法是否已经过时了?
如果上述说法正确,那么如何为 .NET 4.x 中的具体 ASP.NET 应用程序定义 PermissionSet?
Microsoft introduced a new security model on .NET 4.0 and above which is a replacement for code access security. Since trust levels are code access security, is this approach obsolete?
If above statement is in the right way, how do you define a PermissionSet for a concrete ASP.NET application in .NET 4.x?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,ASP.NET 信任级别并未过时。您对这种情况的担忧似乎是由于对 .NET 4.0 中 CAS 变化的误解。 CAS实际上并没有被取代。相反,CAS 的执行方式发生了两个重大变化:
但是,如果您阅读上面的第二篇链接文章,您会发现完全期望 ASP.NET 等主机将继续强制执行 CAS 权限限制。除非您看到直接指示表明 ASP.NET 的某些未来版本将以不同方式处理代码权限限制,否则您应该像过去一样继续依赖信任级别。
No, ASP.NET trust levels are not obsolete. Your concern that this might be the case seems to be due to a misunderstanding of how CAS has changed in .NET 4.0. CAS has not actually been replaced. Instead, there have been two major changes in how CAS is enforced:
However, if you read the second linked article above, you will see that it is fully expected that hosts such as ASP.NET will continue to enforce CAS permission restrictions. Unless you see a direct indication that some future version of ASP.NET will handle code permission restrictions differently, you should continue to rely on trust levels just as you have in the past.