简体   繁体   English

无法加载文件或程序集'Microsoft.Xrm.Client,版本错误

[英]Could not load file or assembly 'Microsoft.Xrm.Client, Version ERROR

I'm creating an ASP web app that will connect to CRM. 我正在创建一个将连接到CRM的ASP Web应用程序。 but I got error every time I run my application: ERROR Could not load file or assembly 'Microsoft.Xrm.Client 但是每次运行我的应用程序时我都会出错:错误无法加载文件或程序集'Microsoft.Xrm.Client

Using the Microsoft.Xrm.Client.dll Version: 5.0.9690.2165 as reference give us an error : 使用Microsoft.Xrm.Client.dll版本:5.0.9690.2165作为参考,会给我们一个错误:

Could not load file or assembly 'Microsoft.Xrm.Client, Version=5.0.9689.2166, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. 无法加载文件或程序集'Microsoft.Xrm.Client,版本= 5.0.9689.2166,文化=中性,PublicKeyToken = 31bf3856ad364e35'或其依赖项之一。 The located assembly's manifest definition does not match the assembly reference. 找到的程序集的清单定义与程序集引用不匹配。 (Exception from HRESULT: 0x80131040) (来自HRESULT的异常:0x80131040)

But when we replace the dll with Microsoft.Xrm.Client.dll Version: 5.0.9689.2166 as reference give us an error: 但是,当我们使用Microsoft.Xrm.Client.dll版本:5.0.9689.2166替换dll作为参考时,会给我们一个错误:

Could not load file or assembly 'Microsoft.Xrm.Client, Version=5.0.9690.2165, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. 无法加载文件或程序集'Microsoft.Xrm.Client,版本= 5.0.9690.2165,区域性=中性,PublicKeyToken = 31bf3856ad364e35'或其依赖项之一。 The located assembly's manifest definition does not match the assembly reference. 找到的程序集的清单定义与程序集引用不匹配。 (Exception from HRESULT: 0x80131040) (来自HRESULT的异常:0x80131040)

And I cant add both version as my Reference. 我不能将两个版本都添加为参考。 I'm confused what version on of the Microsoft.Xrm.Client.dll Version to use to debug this Error. 我很困惑使用Microsoft.Xrm.Client.dll版本上的哪个版本来调试此错误。

Please let us know if you were able to resolve this, if so what was the reason. 如果您能够解决此问题,请告诉我们,原因是什么。

In my case, i had a plugin which was used to create users in MSCRM. 就我而言,我有一个用于在MSCRM中创建用户的插件。

I had two different organizations, Org A and Org B. 我有两个不同的组织, 组织A组织B。

  1. As per functionality it was needed that whenever a new user is created in Org A same should be created in Org B 根据功能,每当在组织A中创建新用户时,都需要在组织B中创建新用户

  2. So we registered the plugin on Org A 所以我们在组织A上注册了插件

  3. As the organization B was created using database restore the same plugin was also registered in org B 由于使用数据库还原创建了组织B,因此在组织B 中也注册相同的插件

  4. So, on Creation of user in Org A, plugin of Org A was triggered, which tried to create User in Org B 因此,在组织A中创建用户时,触发了组织A的插件,该插件试图在组织B中创建用户

  5. At the same time as the same plugin was available in Org B it was also triggered. 同时在组织B中提供了相同的插件时,它也被触发。

  6. As per my understanding Org B also tried to load the assembly Microsoft.Xrm.Client.dll which was currently being used by plugin of Org A . 根据我的理解, Org B还尝试加载程序集Microsoft.Xrm.Client.dll,该程序集目前由Org A的插件使用

So we were getting the error 所以我们得到了错误

Could not load file or assembly 'Microsoft.Xrm.Client, Version=5.0.9689.2166, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Hope this will help somebody! 希望这会帮助到别人!

暂无
暂无

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

相关问题 无法加载文件或程序集 Microsoft.Practices.ServiceLocation,版本 = 1.3.0.0 - Could not load file or assembly Microsoft.Practices.ServiceLocation, Version=1.3.0.0 无法加载文件或程序集 'Microsoft.ReportViewer.Common,版本 = 11.0.0.0 - Could not load file or assembly 'Microsoft.ReportViewer.Common, Version=11.0.0.0 无法加载文件或程序集“ Microsoft.TeamFoundation.WorkItemTracking.Client.QueryLanguage” - Could not load file or assembly 'Microsoft.TeamFoundation.WorkItemTracking.Client.QueryLanguage' 无法加载文件或程序集'microsoft.reportviewer.Common version = 11.0.0.0' - could not load file or assembly ' microsoft.reportviewer.Common version=11.0.0.0' 无法加载文件或程序集Microsoft.Web.Extensions版本1.0.61025 - Could not load file or assembly Microsoft.Web.Extensions Version 1.0.61025 无法加载文件或程序集 Microsoft.Extensions.DependencyInjection,版本=1.1.0.0 - Could not load file or assembly Microsoft.Extensions.DependencyInjection, Version=1.1.0.0 无法加载文件或程序集“Microsoft.IdentityModel.Clients.ActiveDirectory,版本 = 3.19.8.16603。 与程序集引用不匹配 - Could not load file or assembly 'Microsoft.IdentityModel.Clients.ActiveDirectory, Version=3.19.8.16603. does not match the assembly reference 发布错误:无法加载文件或程序集“Microsoft.Web.XmlTransform”,Version = 1.4.0.0,Culture = neutral等等或其依赖项之一 - Publish error: Could not load file or assembly 'Microsoft.Web.XmlTransform', Version=1.4.0.0, Culture=neutral, etc. or one of its dependencies 无法加载文件或程序集“Microsoft.ReportViewer” - Could not load file or assembly 'Microsoft.ReportViewer' 无法加载文件或程序集'Microsoft.mshtml - Could not load file or assembly 'Microsoft.mshtml
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM