Search code examples
c#ajaxdynamics-crmdynamics-crm-2013dynamics-crm-online

TypeLoad Exception. Microsoft Dynamics CRM has experienced an error


At one of our production instance that is CRM 2013 Online we are getting following error in ajax call's (POST) error handler (XHR.responseText):

"error": { "code": "-2147220970", "message": { "lang": "en-US", "value": "System.TypeLoadException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #0EBC6CBF" } } }

The .NET plugin code in question is working fine on our 2013 on-premise development instance with SP1 UR2 installed. I also checked the version number and both Online production isntance and On-premise development instance are set to 6.1.2.112 version.

The plugin code is written in C# and deployed as an assembly over the Dynamics CRM. As this is happening on CRM Online I fear I can't debug the code or take traces of it?


Solution

  • At last I found the culprit - Extension Method - in the plugin code that was causing System.TypeLoadException exception on Dynamics CRM 2013 Online only.

        public static bool IsEqualTo<TSource>(this IEnumerable<TSource> value, IEnumerable<TSource> compareList)
        {
            return IsEqualTo(value, compareList, null);
        }
    

    Plugin fired successfully after removing this.

    Extension method was working perfect on Dynamics CRM 2013 On-Premises and Dynamics CRM 2015 Online and On-premise (in sandbox modes).

    As this was the large code base, thanks to the Dependency Graph feature in VS2013 that helped me in finding this by removing the classes one by one.