工作流程版本控制问题

发布于 2024-07-27 23:50:30 字数 2269 浏览 1 评论 0原文

在我们的项目中,我们使用 WF 来运行工作流程。 .net 版本 3.5。 托管在 IIS 应用程序池内。 显然,我们遇到了一些版本控制问题:

我们从程序集的版本 1 开始工作流程。 到达持久点后,我们升级到版本 2,我们需要能够让旧实例继续使用旧版本的程序集运行。

主工作流程引用了多个程序集。 我们使用程序集绑定,因为我们无法将程序集安装到 GAC 中。 然而,我们遇到了一个非常奇怪的问题:

通过 web.config 中的配置,我们

<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>

显然进行了设置,工作流运行时正确地注意到它需要程序集(如果我们没有进行此配置,它会立即告诉我们,它找不到合适的版本)。

但是,一旦实例被反序列化,它就会抛出异常,表示它无法将“System.Runtime.Serialization.TypeLoadExceptionHolder”转换为工作流程中序列化属性的类型。

奇怪的是,同样的文件(甚至没有重新编译、没有移动、没有重命名)放入 GAC 中可以完美地工作。 你知道我们可能做错了什么吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文