Hi all,
I developed a sandboxed plugin for Dynamics CRM 2011,where I need to use XML and JSON serialization.But when I started to debug the plugin , I was geting the error below:
Unexpected exception from plug-in (Execute): "MyPlugin Name" : System.MethodAccessException: Attempt by security transparent method "the stack trace of the method I use Javascript serialization"
to access security critical method 'System.Web.Script.Serialization.JavaScriptSerializer..ctor()' failed. Assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' is a conditionally APTCA assembly which is not enabled in the current AppDomain. To enable this assembly to be used by partial trust or security transparent code, please add assembly name 'System.Web.Extensions, PublicKey=0024000004800000940000000602000000240000525341310004000001000100B5FC90E7027F67871E773A8FDE8938C81DD402BA65B9201D60593E96C492651E889CC13F1415EBB53FAC1131AE0BD333C5EE6021672D9718EA31A8AEBD0DA0072F25D87DBA6FC90FFD598ED4DA35E44C398C454307E8E33B8426143DAEC9F596836F97C8F74750E5975C64E2189F45DEF46B2A2B1247ADC3652BF5C308055DA9' to the the PartialTrustVisibleAssemblies list when creating the AppDomain.
Whatever I tried ,did not matter. The error is still there.
Now , I think If I will not be able to use even the XML or JavaScript serializations , why is there a sandboxed solution , just for hard coding ?
I hope some of you already figured out how to use such a kind of nice assemblies in sandboxed plugins.
Regards,
Erhan Akova
http://www.isvlabs.com