Problem opening workflows in CRM GUI

Currently I am working on a project with a quite complex sales process and part of it is managed by workflows (for flexibility) and to be able to do what is needed, I have developed several custom workflow activities.

However, today I had just installed some stuff and was going to review one of the workflows, and the CRM GUI crashed with the Exception “System.NullReferenceException” in a really nasty way when I tried to open it. By looking at the stack trace I got a feeling it had something to do with my custom activities so I just reregistered them and then everything started working again. So if you come across this error, this might be the problem. I couldn’t find any reference to this error on the net why I thought it might be a good idea to blog about it.

Gustaf Westerlund
Microsoft Dynamics CRM Architect

Logica
www.logica.com

Workflow activity development and file locking

As some of you might have noticed, the dll:s containing the custom workflow activities might get locked and hence the compilation fails in it’s final stage.

To handle this, I tried a good program called Unlocker 1.8.7 which you can find here: http://ccollomb.free.fr/unlocker/ – it is freeware and it will tell you which processes are locking a file and can help you kill them.

So, what is locking my dll? Well, actually several processes are involved both the MSCRMAsyncService and the IIS worker process (w3wp).

The most obvious way of handling it is just restarting the two services and that will work. However, restarting the w3wp process will require the entire CRM application to be recompiled which will create extra long and annoying waits. Instead, just recycle the applicationpool involved (CRMAppPool).

There are no problems restarting the MSCRMAsyncService.

And if you want to do it all in the pre-build event just add the following lines:

net stop “MSCRMAsyncService”
net start “MSCRMAsyncService”
cscript C:InetpubAdminScriptsadsutil.vbs stop_server W3svc/AppPools/CRMAppPool cscript C:InetpubAdminScriptsadsutil.vbs start_server W3svc/AppPools/CRMAppPool

And if you are still having problems, use the unlocker program!

Gustaf Westerlund
Microsoft Dynamics CRM Architect

Logica
www.logica.com

List Web Part for Dynamics CRM 4.0

Finally Microsoft have release the List Web Part for Dynamics CRM 4.0. I havn’t had the opportunity to test it yet but the previous version (for CRM 3) had problems with non-english versions of SharePoint so be aware, especially if you are running CRM and SharePoint in different base languages.

If you have any experience of it, please let me know.

Gustaf Westerlund
Microsoft Dynamics CRM Architect

Logica
www.logica.com