Video Screencast Help
Symantec to Separate Into Two Focused, Industry-Leading Technology Companies. Learn more.

Getting error: "The located assembly's manifest definition does not match the assembly reference"

Created: 12 Feb 2013 • Updated: 04 Mar 2013 | 5 comments
This issue has been solved. See solution.

I'm setting up a Symantec Workflow 7.1.2 environment at the moment, but having an issue with one of our workflows that references the FirebirdSql.Data.FirebirdClient.dll. Version 2.0.0.0 gets initially installed with Symantec Workflow, but since my group knows that version of the dll is incompatible with this workflow, we've manually had to replace that dll with version 2.5.0.0 in our current workflow environments, where we see no issues.

So, in our newly set up environment, I'm running the workflow and getting the following error. However, only, when deployed. Running in debug results in intended behavior.

Could not load file or assembly 'FirebirdSql.Data.FirebirdClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

System.IO.FileLoadException: Could not load file or assembly 'FirebirdSql.Data.FirebirdClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) File name: 'FirebirdSql.Data.FirebirdClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c' at CWx.Databases.Firebird.SqlQuery.GetAddressCheckHostname.Run(IData data) at LogicBase.Core.ExecutionEngine.SinglePathProcessComponentExecutionDelegate.Execute(IData data, IOrchestrationComponent comp, String& outputPath, IExecutionEngine engine, TLExecutionContext context) at LogicBase.Core.ExecutionEngine.AbstractExecutionEngine.RunComponent(TLExecutionContext context, IData data, IOrchestrationComponent comp)

What I've done so far is:

- Cleared out seemingly all traces of the workflow. The project folder, deploy folder, the IIS app pool and temporary .NET files. Restarted IIS and server.

- Reinstalled the workflow, manually added the new dll in the Libraries tab in Workflow Designer, checked the Publish checkbox.

- Validated that the old dll was replaced with the new one in both the install directory's \shared\lib folder and this specific workflow's \bin\ folder. I also added this dll into the server's GAC as an extra step.

- Added the following into the workflow's web.config file after deploying it:

<?xml version="1.0" encoding="utf-8"?>

<configuration>

  <system.web>

    <compilation defaultLanguage="c#" debug="false">

      <assemblies>

              <add assembly="FirebirdSql.Data.FirebirdClient, Version=2.5.0.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c"/>

        </assemblies>

    </compilation>

...

I'm still getting the same error, but I have no idea where any references of the old 2.0.0.0 dll would exist. Anyone have any thoughts? Thanks.

Comments 5 CommentsJump to latest comment

reecardo's picture

Have you verified if this DLL is in the GAC (global assembly cache)? Check the C:\windows\assembly path... if it's there, there could be some confusion being raised about which DLL version to load.

bobbymc's picture

The 2.0.0.0 dll was not in the GAC prior or during the time that I noticed this issue.

I have tried both of (1) placing the 2.5.0.0 dll in the GAC and (2) leaving the 2.5.0.0 version out of the GAC.

rhamner's picture

I was thinking since this is a signed assembly that Workflow was compiled against this isn't going to work unless the Firebird installer creates a publisher policy that redirects old versions to the new version or you create an Assembly Binding Redirection. However, that doesnt explain why it works in debug.

Try to also add the binding redirection to the web.config. It should be something like this. You may already have the runtime section in your config.

  <runtime>
    <assemblyBinding>
      <dependentAssembly>
        <assemblyIdentity name="FirebirdSql.Data.FirebirdClient" publicKeyToken="3750abcc3150b00c" />
        <bindingRedirect oldVersion="2.0.0.0" newVersion="2.5.0.0" />
        <publisherPolicy apply="no" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
bobbymc's picture

Will have to do more testing to see if this sticks, but I think I found a solution.

Seems to be a very specific combination of things that allowed this to work for me. I had to make sure these 4 exact things happen:

1. Add 2.5.0.0 dll into GAC.

2. In workflow's web.config, add 2.5.0.0 dll in <assemblies> section, as noted in my first post.

3. In web.config, create an <assemblyBinding> to redirect version 2.0.0.0 to 2.5.0.0, as noted in rhamner's post.

4. Remove 2.5.0.0 dll from the \WorkflowDeploy\Release\<workflow>\bin\ folder.

I think it was ultimately the 4th step that had me confused. By default, the new 2.5.0.0 dll was added to the workflow's bin folder, which is what I thought I wanted. Also, each time I redeploy this workflow, it gets re-added. Not sure why this works, but once I removed it from the folder, I finally got the workflow to run without error.

What also confused is that in our current production environment (running an older 7.0 version of Workflow), the 2.5.0.0 dll is not in the GAC, there are no references to it in the web.config, but it IS in the bin folder. All we had to do is simply replace the old dll with the new in the Windows Explorer.

SOLUTION
rhamner's picture

In your project go to the Libraries tab and uncheck 'publish' from the firebird library. This way you don't have to remember to go and delete it after deploying.