I’m having to maintain a system running windows workflow foundation, changes need to be made to the Workflows so I’m developing them in a new version of the workflow project, say Version 2.0.0.0
I need to run Version 1.0.0.0 workflows, at the same time as Version 2.0.0.0 workflows, with new workflows being created using the latest assembly.
I’ve read this great explanation on running multiple versions of workflows, and within my app.config I have the following:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="some.namespace.workflow" publicKeyToken="null" />
<codeBase version="1.0.0.0" href="legacy/version_1_0_0_0/some.namespace.workflow.dll"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
However, the new workflows always get created with version 1.0.0.0 – even though I’ve changed the version of the related Workflow project to 2.0.0.0
The only difference I can see is that my assemblies aren’t strongly named, could this be what’s causing it?
Thank you.
UPDATE:
I think this problem might be related to the way I’m loading the assembly by using:
Assembly asm = Assembly.Load("some.namespace.workflow");
This chap is suggesting that you need to strong name your assemblies to use the Assembly.Load method – is this true?
Yes, the assembly containing your workflow should be strongly named. For me it was like, learn things the hard way. I created hundreds of WF instances and then I changed the WF structure. Once this was done, all the older instances failed because WF was unable to de-serialize them into proper objects. Ensure that before you push your WF codebase into production, you have strongly named all the relevant assemblies.