System.InvalidOperationException on Dynamics CRM 2011 Plugin & Workflow

Today, I was facing a strange error on one of the custom workflow activity. The workflow when run in production environment was going into waiting state whenever there was two or more simultaneous execution.

Looking at the Systemjobs, it showed the following error

System.InvalidOperationException: Microsoft Dynamics CRM has experienced an error.
Exception: You cannot create a SqlExecutionContext from another SqlExecutionContext on which OnBeginRequest has not been called

Continue reading

Debug Plugin in Dynamics CRM 2011

In earlier versions of CRM, in order to debug any Plug-in or Custom workflow activity it was mandatory to copy the DLL and PDB files to “%Microsoft Dynamics CRM%\server\bin\assembly” directory and then attach the source code to server’s worker process i.e. w3wp.exe

Dynamics CRM 2011 provides a better mechanism by which developers can achieve the above with just few clicks and without accessing the CRM server.

Here’s how
Continue reading