Earlier I wrote about a bug in Windows Workflow Foundation where it was no longer possible to resume workflows that were persisted in a SQL when you change an activity while there are persisted workflows in the database. After having created a small test I can confirm it's definitly a problem with the versioning of the custom activities when serializing workflows using the SQL workflow persistence service.
The application gives an error similar to the following on the console output:
A first chance exception of type 'System.IndexOutOfRangeException' occurred in System.Workflow.ComponentModel.dll
I couldn't get more information at this time as visual studio was giving me problems and threw an TargetInvocationException instead of coughing up the real problem. This is probably because I used a WPF frontend to make a quick and dirty user interface for my test application.
It buggers me a lot that this happens, because the chance that activities get updated within a running application is very real. This simply means that running workflows will have to be discarded from the persistence store to prevent this bug from happening. I have a work around in mind, but that involves kicking the workflow instances from the persistence and reboot them and manually set them to their correct state. However, this is only possible for statemachine workflows and not for the sequential workflows.
I included the code I used to test the bug, for those who like to experiment with this.