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

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

重写成员“JsonRpc.Standard.JsonRpcException.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)”时违反了继承安全性规则。重写方法的安全可访问性必须与所重写方法的安全可访问性匹配。

发表回复

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

ERROR: si-captcha.php plugin: GD image support not detected in PHP!

Contact your web host and ask them to enable GD image support for PHP.

ERROR: si-captcha.php plugin: imagepng function not detected in PHP!

Contact your web host and ask them to enable imagepng for PHP.

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据

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