A "System.BadImageFormatException: Could not load file or assembly" Error Occurs When Publishing a Workflow With A Custom Activity In Workflow 8.

May 21, 2012 | KB: 1012980
Workflow Suite 8

Summary

When you have a custom activity that contains a reference to a 32-bit library/assembly and you attempt to publish a workflow that contains that activity on a 32-bit (x86) version of the Workflow Server that is installed on a 64-bit (x64) version of Windows, you may receive an error message similar to the following:

    Failed to publish workflow 'Workflow 1': error WF279: Could not create activity of type 'Laserfiche.Workflow.DynamicallyGenerated.Workflow1'. System.BadImageFormatException: Could not load file or assembly 'Your32bitAssembly, Version=x.x.x.x, Culture=neutral, PublicKeyToken=ab1cd2ef34fe56dc' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Resolution

There is a hotfix for Workflow Server 8.3.1. The fix is an updated version of the 32-bit version of Laserfiche.Workflow.Compiler.exe (8.3.1.167).

  1. Click the following link to download a zip file containing the updated Laserfiche.Workflow.Compiler.exe.
  2. KB1012980.zip

  3. Stop the Workflow Server and Subscriber services.
  4. In the Workflow installation folder, rename the original Laserfiche.Workflow.Compilers.exe file.
  5. Extract the contents of the hotfix and place the updated Laserfiche.Workflow.Compilers.exe in the Workflow installation folder.
  6. Restart the Workflow services.