Reflection restrictions in Silverlight

前端 未结 1 1095
不思量自难忘°
不思量自难忘° 2020-12-20 15:56

Where described well-known reflection restrictions for Silverlight types?

For example: if I try to set protected or private property value with PropertyInfo.Se

相关标签:
1条回答
  • 2020-12-20 16:33

    For security purposes, reflection in Silverlight is limited to what is available at compile time. Mostly this means you can only access public members.

    Here's what MS says about it: http://msdn.microsoft.com/en-us/library/stfy7tfc(VS.95).aspx

    The reason for this is that the Silverlight internals are mostly private or internal to the main Silverlight assembly. If I could call those private functions without any parameter checking, I might be able to write a Silverlight app that reads your private files or something like that.

    0 讨论(0)
提交回复
热议问题