c# - CRM Custom Workflow Errors on AutoMapper System.TypeInitializationException -


i have project (crm custom workflow) works locally on deploy throws system.typeinitializationexception.

now clarify local scenario using mvc test harness deployment (on prem) msoft dynamics crm 2013 server.

two important pieces puzzle. using automapper , ilmerge. ilmerge doesn't appear connected in way wanted still make known.

my project structure customer workflow 1 project in solution. have core functionality library in same solution.

so custom workflow references core library. core library references automapper.

both project have ilmerge. thought/understanding ilmerge build core library references (automapper) single dll...and appears so.

i reference single core library in custom workflow project , again using ilmerge combine 2 (core library & workflow) 1 workflow library.

again works local test harness upon deployment fails @ first reference automapper.

so in workflow:

protected override void execute(codeactivitycontext executioncontext) {     ....code...     tracingservice.trace("preinit");     corecrm.initialize.start();     tracingservice.trace("postinit");     .....more code.... } 

the core initialization registering map this:

[assembly: preapplicationstartmethod(typeof(corecrm.initialize), "start")] namespace corecrm {     public class initialize    {       public static void start()       {          mapper.initialize(cfg =>          {             assembly.getexecutingassembly()                     .findallderivedtypes<profile>()                     .foreach(match =>                       {                          cfg.addprofile(activator.createinstance(match) profile);                       });         });       }    } } 

i using preapplicationstartmethod crm web based solution , error comes within start() seems me working.

the error , full stack is:

plugin trace:  preinit    error message:  unhandled exception: microsoft.crm.crmexception: unexpected exception plug-in  (execute): crmworkflow: system.typeinitializationexception: type initializer 'automapper.queryableextensions.extensions' threw exception. @ microsoft.crm.sandbox.sandboxcodeunit.execute(iexecutioncontext context) @ microsoft.crm.workflow.services.proxycustomactivity.execute(codeactivitycontext executioncontext) 

one thought had..but grasping @ straws..is perhaps custom workflow has reference automapper...but doesn't make sense.

the system event log shows nothing. @ loss , appreciate direction or input...even additional tracing / debugging techniques.

thank you


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -