We were getting the below error in one of our plugins. The reason was because we were making use of HttpContext class of System.Web assembly.
For our on-premise deployment it was working fine, we were getting this issue only on registering plugin on Sandbox mode.
We can find the explanation here
One thought on “Security Exception: That assembly does not allow partially trusted callers in CRM 2011 plugin.”