How can the size (MB) of a workflow assembly be reduced?
An assembly with 4 custom workflow activities is 2.5 MB with the class that crmcsvutil.exe generates from CRM; the same assembly is 18 KB when the generated class is not included in the project!
Plugin registration often fails after timing out, so I would really like to reduce the size of the assembly.
I have tried placing the generated class in a separate assembly and referencing it, and placing the assembly in the GAC, but get an error.
This is when the assembly is registered in the sandbox (which I really prefer):
Assembly 'Tinkerbell.Workflows, Version=2.0.3.4, Culture=neutral, PublicKeyToken=692195edcbe6b163' is partially trusted, which causes the CLR to make it entirely security transparent regardless of any transparency annotations in the assembly itself. In order to access security critical code, this assembly must be fully trusted.'
This is when the assembly is registered outside of the sandbox:
'Object of type 'Microsoft.Xrm.Sdk.Entity' cannot be converted to type 'BusinessUnit'.'
What are the options here?
I am unwilling to give up early bound classes.