简体   繁体   English

无法加载文件或程序集。 定位的程序集的清单定义与程序集引用不匹配

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

I am trying to add one of the google vision API feature in the blue prism but I am getting the error我正在尝试在蓝色棱镜中添加谷歌视觉 API 功能之一,但出现错误

"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)" “内部:无法执行代码阶段,因为代码阶段抛出异常:无法加载文件或程序集 'Google.Apis.Auth, Version=1.35.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab' 或其依赖项之一。找到的程序集的清单定义与程序集引用不匹配。(来自 HRESULT 的异常:0x80131040)”

But the mentioned dll is available in the Blue prism folder and I have added the reference in the initialize page.但是提到的 dll 在 Blue Prism 文件夹中可用,我在初始化页面中添加了引用。 The current version of Google.Apis.Auth is 1.40.2 but I tried the version 1.35.1.0, still no use. Google.Apis.Auth当前版本是1.40.2,但是我试过1.35.1.0版本,还是没有用。 I tried adding the reference "Google.Cloud.PubSub.V1" as mentioned in the other thread but that doesn't resolve the issue as well.我尝试添加另一个线程中提到的参考“Google.Cloud.PubSub.V1”,但这也不能解决问题。

The below code with the dll references mentioned here is working well in the visual studio but not in blueprism.带有此处提到的 dll 引用的以下代码在 Visual Studio 中运行良好,但在 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;
       }
  }        

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:您可以尝试将程序集绑定添加到您的 app.config 文件或 web.config 文件(取决于您的项目类型),如下所示:

<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.基本上它在运行时说,任何依赖于 0.0.0.0-1.40.2.0 版本的“Google.Apis.Auth”的东西,使用 1.40.2.0 版本的程序集。 And then you can reference the newest version.然后您可以参考最新版本。


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. 1- 通过将其放入 GAC 或您的应用程序路径,确保它可以找到正确版本的参考。
2- You may also check your version in packages.config or web.config . 2- 您也可以在 packages.config 或 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 . 3- 在您的硬盘驱动器中搜索程序集,在结果页面中选择每个文件,查看属性中的详细信息选项卡并检查版本,以便您可以找到不需要的版本的来源。
4- delete bin folder and rebuild. 4-删除bin文件夹并重建。
check this link too.也检查这个链接

Check the Web.config of your web application.检查 Web 应用程序的 Web.config。 I saw a duplicate entry in mine.我看到了我的重复条目。 One had all caps public token.一个有全部大写的公共令牌。 So I am guessing it is case sensitive and didn't over-write when I upgraded the version.所以我猜它是区分大小写的,并且在我升级版本时没有覆盖。 So it kept using the old version number, which I had obviously uninstalled.所以它一直使用旧版本号,我显然已经卸载了。 This is probably a rare occurrence but it could help someone else.这可能是一种罕见的情况,但它可以帮助其他人。 Hope this helps.希望这可以帮助。

This was the duplicate that existed (below).这是存在的副本(如下)。

<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.27.1.0" newVersion="1.27.1.0" />
  </dependentAssembly>
<dependentAssembly>
    <assemblyIdentity name="Google.Apis.Auth" publicKeyToken="4b01fa6e34db77ab" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-1.47.0.0" newVersion="1.47.0.0" />
  </dependentAssembly> </assemblyBinding>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法加载文件或程序集。 找到的程序集的清单定义与程序集引用不匹配。 版本冲突 - Could not load file or assembly. The located assembly's manifest definition does not match the assembly reference. Version conflict Windows Universal App:无法加载文件或程序集-找到的程序集的清单定义与程序集引用不匹配 - Windows Universal App: Could not load file or assembly - The located assembly's manifest definition does not match the assembly reference 无法加载文件或程序集:找到的程序集的清单定义与程序集引用不匹配 - Could not load file or assembly: The located assembly's manifest definition does not match the assembly reference 无法加载文件或程序集“WebGrease”的依赖项之一。 定位的程序集的清单定义与程序集引用不匹配 - Could not load file or assembly 'WebGrease' one of its dependencies. The located assembly's manifest definition does not match the assembly reference 无法加载文件或程序集或其依赖项之一。 找到的程序集的清单定义与程序集引用不匹配 - Could not load file or assembly or one of its dependencies. The located assembly's manifest definition does not match the assembly reference 无法加载文件或程序集XXX或其依赖项之一。 找到的程序集的清单定义与程序集引用不匹配 - Could not load file or assembly XXX or one of its dependencies. The located assembly's manifest definition does not match the assembly reference 无法加载文件或程序集 &#39;MySql.Data, Version=8.0.29.0.. 找到的程序集的清单定义与程序集引用不匹配 - Could not load file or assembly 'MySql.Data, Version=8.0.29.0.. The located assembly's manifest definition does not match the assembly reference 找到的程序集的清单定义与程序集引用不匹配 - The located assembly's manifest definition does not match the assembly reference “定位的程序集的清单定义与程序集引用不匹配” - “The located assembly's manifest definition does not match the assembly reference” 无法加载文件或程序集“System.Web.Mvc”或其依赖项之一。 定位的程序集的清单定义与程序集不匹配 - Could not load file or assembly 'System.Web.Mvc' or one of its dependencies. The located assembly's manifest definition does not match the assembly
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM