在部分受信任程序集中,所有的代码都是安全透明的

所以在这个程序集里,即使你给你自己的Exception派生类的GetObjectData重写应用了SecurityCriticalAttribute,这个函数实际上还是安全透明(Security Transparent)的。(可以用反射获知。)但Exception.GetObjectData是安全关键(Security Critical)的,所以在沙盒程序集中以部分信任的方式加载引发TypeLoadException也算是在情理之中吧。比如

Text is available under CC BY-SA 4.0 license, unless otherwise noticed; additional terms may apply.

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理

Content is available under CC BY-SA 3.0 unless otherwise noted.