locked
Early-bound types and sandbox RRS feed

  • Question

  • Hey all,

    I am trying to use early bound types in CRM 2011 in sandbox mode (Online as well) but I'm getting a Security exception:

     

    Plugin Trace:
    
    [Score.SgrCostsBatchPlugin: Score.SgrCostsBatchPlugin.SgrCostsBatchPlugin]
    [548be27c-e87a-e011-8219-000c29bc0c32: Score.SgrCostsBatchPlugin.SgrCostsBatchPlugin: Create of sgr_sgrcostbatchcoupling]
    
    
    
    Error Message:
    
    Unhandled Exception: Microsoft.Xrm.Sdk.InvalidPluginExecutionException: Unexpected exception from plug-in (Execute): Score.SgrCostsBatchPlugin.SgrCostsBatchPlugin: System.TypeLoadException: Inheritance security rules violated by type: 'Score.SgrCostsBatchPlugin.Sdk.sgr_batch'. Derived types must either match the security accessibility of the base type or be less accessible.
     at Microsoft.Crm.Asynchronous.EventOperation.CreateAsyncResultFromException(AsyncExecutionContext context, Exception e)
     at Microsoft.Crm.Asynchronous.EventOperation.InvokePlugin(AsyncExecutionContext context, IPlugin pluginInstance)
     at Microsoft.Crm.Asynchronous.EventOperation.InternalExecute(AsyncEvent asyncEvent)
     at Microsoft.Crm.Asynchronous.AsyncOperationCommand.Execute(AsyncEvent asyncEvent)
     at Microsoft.Crm.Asynchronous.QueueManager.PoolHandler.ProcessAsyncEvent(AsyncEvent asyncEvent)
    Inner Exception: Microsoft.Crm.CrmException: Unexpected exception from plug-in (Execute): Score.SgrCostsBatchPlugin.SgrCostsBatchPlugin: System.TypeLoadException: Inheritance security rules violated by type: 'Score.SgrCostsBatchPlugin.Sdk.sgr_batch'. Derived types must either match the security accessibility of the base type or be less accessible.
     at Microsoft.Crm.Sandbox.SandboxPlugin.Execute(IServiceProvider serviceProvider)
     at Microsoft.Crm.Asynchronous.EventOperation.InvokePlugin(AsyncExecutionContext context, IPlugin pluginInstance)
    
    I even tried getting the entities with crmsvcutil from CRM 2011 online, but it doesn't matter for the generated code. When deploying normally (not sandboxed) the plugin executes just fine. Attaching the debugger does not hit any breakpoint as this occurs while loading the assembly and before executing the plugin.

     

    Any ideas?


    Wednesday, May 11, 2011 12:19 PM

All replies

  • Hi Alex,

    Did you ever get this sorted out??


    http://nzcrmguy.blogspot.com/ http://nzspguy.blogspot.com/

    Tuesday, April 3, 2012 1:43 AM