How to deny reflection using ReflectionPermission

前端 未结 2 1005
野趣味
野趣味 2020-12-31 03:35

I am trying to add addons in my application, but I don\'t want the addon to use reflection at all, the addon code can be sandbox using Application Domain.

I have fo

2条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-31 04:12

    According to the documentation, ReflectionPermission is something you grant to give code access to private and protected members. By default it is not granted and code only has access to public members. If you are trying to hide the public members, you will need to create a new interface that does not expose them.

提交回复
热议问题