As of right now, there are no documents (whitepapers) available that pertain specifically to workflow versioning other than what you will find on MSDN at http://msdn2.microsoft.com/En-US/library/aa349375.aspx.
However, out on the forum http://wf.netfx3.com, there have been several posts related to versioning and to give you an executive summary of what you need to do, there are basically two ways (without doing lots of coding) to handle versioning:
Here is a link to assembly versioning steps in .Net:
http://msdn2.microsoft.com/en-us/library/51ket42z(vs.71).aspx
So, that was the executive summary, but even within these two types of versioning tactics, there are some other things to consider:
So, how does an persisted, unloaded workflow know which version of the assembly to use when it is reloaded? When the workflow gets serialized to the database serialized (binary), the assembly and type information gets serialized as well. This is normal .NET serialization (BinaryFormatter), not anything workflow-specific. Upon deserialization, .NET will automatically load the correct assembly based on version (assuming the correct version of the assembly exists in the GAC or config and can be resolved).
The workflow runtime actually knows nothing about workflow versions or any of that. The instant we serialize a workflow, it’s no longer WF – it’s .NET from then on up to the point after the WF is deserialized again.
Hi,
Can you kindly give us an example of how to versioning workflow using GAC, side-by-side assemblies? I tried to version my .xoml via side-by-side assemblies in the GAC, but it kept rigidly pointing to either one version, but not all versions as it should. I add the reference assembly via the web.config pointing only one highest version. If I add all of the versions, the clr states that duplicated objects/references found.
I appreciate for this post, but can you go one step further in illustrating this. Thank you very much.
A couple of questions:
1. You say you are trying to version your .xoml workflows so I'm assuming here you have these .xoml workflows inside of your assemblies right?
2. How are you hosting your workflow? Sounds like IIS but does that mean you have your workflow exposed as a WCF and you are hosting via IIS?
When I have done this in the past, I had to change the version of the assembly in the assembly.cs file and then deploy that to the GAC. Not sure why yours keeps going to the highest version because the unloaded workflow should have the information it needs to find the correct version.
I would suggest posting the details above of this problem on the MSDN workflow forum at http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=122&SiteID=1 to see if others have seen the same thing. There are quite a few MVPs plus Microsoft product team folks that monitor that site (plus me).