Could not load file or assembly. The located assembly's manifest definition does not match the assembly reference

0

I am trying to add one of the google vision API feature in the blue prism but I am getting the error

"Internal: Could not execute code stage because an exception is thrown by code stage: Could not load file or assembly 'Google.Apis.Auth, Version=1.35.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"

But the mentioned dll is available in the Blue prism folder and I have added the reference in the initialize page. The current version of Google.Apis.Auth is 1.40.2 but I tried the version 1.35.1.0, still no use. I tried adding the reference "Google.Cloud.PubSub.V1" as mentioned in the other thread but that doesn't resolve the issue as well.

The below code with the dll references mentioned here is working well in the visual studio but not in blueprism.

Please, someone, help me to resolve this issue

  var image = Image.FromFile("C:/New folder/Google VisionAI/otter_crossing.jpg");
  var client = ImageAnnotatorClient.Create();
  var response = client.DetectText(image);      

  foreach (var annotation in response)
  {
       if (annotation.Description != null)
       {
           Output = annotation.Description;
       }
  }        
c#
.net
google-vision
blueprism
asked on Stack Overflow Jul 25, 2019 by robt • edited Jul 26, 2019 by robt

2 Answers

0

It might be a dependency version conflict, meaning your app may have dependency on multiple versions of the assembly. You can try to add assembly binding to your app.config file or web.config file (depends on your project type), something like this:

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Google.Apis.Auth" publicKeyToken="4b01fa6e34db77ab" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-1.40.2.0" newVersion="1.40.2.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>

Basically it says in runtime, anything that depends on "Google.Apis.Auth" from version 0.0.0.0-1.40.2.0, use the assembly with version 1.40.2.0. And then you can reference the newest version.

answered on Stack Overflow Jul 25, 2019 by SherryRuan
0


As the error says, it can't find the specific version of the reference you want; so, there may be a mismatch between assemblies. You could do couple of things to troubleshoot:
1- Make sure that it can find the right version of the reference by putting it in the GAC or in your application path.
2- You may also check your version in packages.config or web.config .
3- Search your hard drive for the assembly, select each files in the result page, see the detail tab in properties and check the versions so you can find from where the unwanted version is coming .
4- delete bin folder and rebuild.
check this link too.

answered on Stack Overflow Jul 25, 2019 by Simin Maleki

User contributions licensed under CC BY-SA 3.0