The everyday life of a Dynamics AX developer
When trying to view or edit a workflow, the following error can pop up:
An unexpected error has occurred while opening the workflow. See the event log on the AOS and contact your system administrator to resolve the issue.
This is a general error and it could mean a lot of things. Make sure you check the obvious things first:
Well… you know… do the usual.
In my case, none of this helped. Because this was a CLR exception, I modified the try/catch in the method that was throwing the error to show the inner exception. The method Forms\WorkflowEditorHost.run was modified so it looked like this:
After trying to open the workflow again, this was the inner exception:
Kan een object van het type System.Windows.Input.CommandBinding niet converteren naar het type System.Activities.Presentation.View.DesignerView.
Cannot convert an object of type System.Windows.Input.CommandBinding to the type System.Activities.Presentation.View.DesignerView.
The fact that the error was in Dutch gave me a clue. Turn out a language pack for .NET framework 4 was installed on the machine. However, recently the .NET framework 4.5.2 was also installed on that machine. After installing the Language Pack for Microsoft .NET Framework 4.5 (link) and rebooting the machine, the error was solved.