Workflow versioning issues with eventing (External Data Exchange) and tracking services

Last Summer, I came across an interesting problem on wrokflow versioning. It included versioning for ExternalDataExchange and tracking service. There's a simple fix for workflow and ExternalDataExchange but tracking service versioning issue could be fixed only through a hot fix. Please see below for more details. 

You  have a simple test state machine workflow with Started state, an Approved state, a Rejected state, and a Completed state. Each state has a corresponding event handler that is used to transition from state to state by raising the appropriate event. Host application is an ASP.Net web application and the workflow assembly is put in GAC. It all works and then you create a few instances of the workflow, transition them to the Started state, and then decide to add a Canceled state. Now, re-version the assembly to 1.0.0.2, place a copy in the GAC, create a few instances of the new workflow. The problem occurs when you try to go back and re-hydrate a workflow created under my workflow ver. 1.0.0.1. If you try to transition the workflow to the Approved state from the Started state, the following error occurs:

Event Queue operation failed with MessageQueueErrorCode QueueNotFound for queue
'Message Properties
Interface Type:Workflows.IApprove
Method Name:Approved
CorrelationValues:
'.

So, the question is: how do i version the workflow so that the workflow persisted using the older assemblies still works?

Solution 1: It is standard .net versioning, so you can do it any way that you would do it with non workflow assemblies that you need to version:
https://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconassemblyversioning.asp

You can register them as side by side in the gac or keep them in private folders. You can use TypeProvider to make sure that they are available to the runtime, like this:

TypeProvider typeProvider = new TypeProvider(wfruntime);
Assembly wf1 = Assembly.LoadFrom(Path.Combine(Files, "Workflow1.dll")); // this
could be the old version
typeProvider.AddAssembly(wf1);
wfruntime.AddService(typeProvider); // now WF Runtime can find the old version when it needs it

Solution 2: A much better soulution would be:
Configure for assemly binding re-redirection through the configuration file.
https://msdn.microsoft.com/en-us/library/433ysdt1(VS.80).aspx

Example:

<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
 <assemblyIdentity name="Workflows" publicKeyToken="a62305a49c4d454f" culture="neutral" />
 <bindingRedirect oldVersion="1.0.0.0-1.0.0.1" newVersion="1.0.0.2"/>
</dependentAssembly>
</assemblyBinding>
</runtime>

However, in ASP.Net application make sure that start of web.config file is "<configuration>" instead of "<configuration xmlns="<https://schemas.microsoft.com/.NetConfiguration/v2.0>"

Solution for versioining issue with custom tracking service:

You also see the above exception when a custom tracking service that tracks persisted workflows in Windows Workflow Foundation is updgraed to a newer version and the persisted workflows do not run. Please see the below article for more information.

956630 FIX: Persisted workflows do not run after you upgrade the tracking service to a newer version in Windows Workflow Foundation
https://support.microsoft.com/default.aspx?scid=kb;EN-US;956630