【发布时间】:2013-08-14 05:32:57
【问题描述】:
我在CRM.创建了一个插件,注册成功。在我的插件中,我创建了一个具有许多功能的 Web 服务。
成功调用插件步骤后出现错误-
System.IO.FileNotFoundException:无法加载文件或程序集“Microsoft.Xrm.Client,版本=5.0.9689.2166,Culture=neutral,PublicKeyToken=31bf3856ad364e35”或其依赖项之一。该系统找不到指定的文件。 为了解决这个问题,我从 crmsvcutil.exe 创建了 New XRM.cs 文件,但遇到了同样的问题。对此进行了更多搜索,但尚未找到解决方案。
注意:我使用的是 Microsoft 托管版本的 CRM
下面是我正在使用的参考文件。
- microsoft.crm.sdk.proxy
- Microsoft.CSharp
- microsoft.xrm.client
- microsoft.xrm.portal
- microsoft.xrm.sdk
- 系统
- 系统 System.Core
- 系统数据
- System.Data.Services
- System.Data.Services.Client
- System.DirectoryServices.AccountManagement
- System.Runtime.Serialization
- System.ServiceModel
- System.Xml
- System.Xml.Linq
有什么方法可以在托管版本的 CRM 上运行我的插件???
如果有帮助,不胜感激:)
【问题讨论】:
-
它不工作。我已经创建了新的 XRM.cs 文件。在我的插件中查看代码 ` var connection = CrmConnection.Parse("ServiceUri=myconnectiondetails"); var service = new OrganizationService(connection); var context1 = new CrmOrganizationServiceContext(connection); var xrm = new XrmServiceContext(context1);`. xrm 对象引发了这个问题。
-
我认为大卫的答案可能是钱。另请查看描述类似内容的this answer。
-
我们可以这样使用
IOrganizationServiceFactory serviceFactory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory)); IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId); var xrm = new XrmServiceContext(service); -
SDK库的版本号是多少>