Unfortunately, the readonly
modifiers on your fields will not prevent post-construction modification via reflection. There is no way to prevent code with private reflection permissions from making modifications to in-memory application state. In fact, ReflectionPermission
is considered one of the "dangerous" permissions, for which a grant is essentially analogous to a full trust grant (http://msdn.microsoft.com/en-us/library/wybyf7a0.aspx).
In other words, you might as well not bother sandboxing at all if you're going to grant private reflection permissions in the sandbox...