views:

118

answers:

0

In our project, we use WF to run workflows. .net version 3.5. Hosted inside an IIS application pool. Apparently, we run into some versioning issues:

We start a workflow with version 1 of our assemblies. After we get to a persistence point, we upgrade to version 2, we need to be able to let the old instances continue to run with the old version of our assemblies.

The main workflow references several assemblies. We use assembly binding, because we cannot install our assemblies into the GAC. However, we run into a very weird problem:

with our configuration in the web.config, we set

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="Post.Appl.Corp.Sdds.Core" culture="neutral" publicKeyToken="58aaab7e0ddb1742" />
    <codeBase version="1.2.11.0" href="v11\Post.Appl.Corp.Sdds.Core.dll"/>
    <codeBase version="1.2.12.0" href="v12\Post.Appl.Corp.Sdds.Core.dll"/>
  </dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="Post.Appl.Corp.Sdds.Workflows" culture="neutral" publicKeyToken="58aaab7e0ddb1742" />
    <codeBase version="1.2.11.0" href="v11\Post.Appl.Corp.Sdds.Workflows.dll"/>
    <codeBase version="1.2.12.0" href="v12\Post.Appl.Corp.Sdds.Workflows.dll"/>
  </dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="Post.Appl.Corp.Sdds.Data" culture="neutral" publicKeyToken="58aaab7e0ddb1742" />
    <codeBase version="1.2.11.0" href="v11\Post.Appl.Corp.Sdds.Data.dll"/>
    <codeBase version="1.2.12.0" href="v12\Post.Appl.Corp.Sdds.Data.dll"/>
  </dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="Post.Appl.Corp.Sdds.Contracts" culture="neutral" publicKeyToken="58aaab7e0ddb1742" />
    <codeBase version="1.2.11.0" href="v11\Post.Appl.Corp.Sdds.Contracts.dll"/>
    <codeBase version="1.2.12.0" href="v12\Post.Appl.Corp.Sdds.Contracts.dll"/>
  </dependentAssembly>
</assemblyBinding>

apparently, the workflow runtime correctly notices that it needs the assemblies (if we don't have this configuration made, it immediately tells us, that it cannot find the appropriate version).

However, once the instance is being deserialised, it throws an exception, saying it cannot convert "System.Runtime.Serialization.TypeLoadExceptionHolder" to the type of a serialised property in our workflow.

The weird thing is, that the very same files (not even recompiled, not moved, not renamed) put into GAC work perfectly. Do you have any idea what we might be doing wrong?