通过Live服务进行Dynamics CRM连接会产生错误

时间:2016-09-22 07:44:12

标签: wcf dynamics-crm dynamics-crm-2013 dynamics-crm-online

您好我尝试使用Godaddy服务器上托管的Live wcf rest服务连接CRM在线2016但是它给出了以下错误。但它在localhost中运行良好。

错误:

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

File name: 'Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

   at Microsoft.Xrm.Sdk.Client.ServiceMetadataUtility.RetrieveACSIssuerEndpoints(Uri trustUrl)

   at Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1.SetAuthenticationConfiguration()

   at Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1..ctor(Uri serviceUri, Boolean checkForSecondary)

   at Microsoft.Xrm.Sdk.Client.OrganizationServiceConfiguration..ctor(Uri serviceUri, Boolean enableProxyTypes, Assembly assembly)

   at Microsoft.Xrm.Sdk.Client.ServiceConfigurationFactory.CreateConfiguration[TService](Uri serviceUri, Boolean enableProxyTypes, Assembly assembly)

   at Microsoft.Xrm.Sdk.Client.ServiceConfigurationFactory.CreateConfiguration[TService](Uri serviceUri)

   at Microsoft.Xrm.Sdk.Client.ServiceProxy`1..ctor(Uri uri, Uri homeRealmUri, ClientCredentials clientCredentials, ClientCredentials deviceCredentials)

   at PortalRestfulService.Service1.authentication(CRMCredential objauthentication)



WRN: Assembly binding logging is turned OFF.

To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.

Note: There is some performance penalty associated with assembly bind failure logging.

To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

请建议我解决。

1 个答案:

答案 0 :(得分:1)

尝试将IdentityModel dll复制到bin文件夹中。

但是,因为Godaddy中的WCF服务可能使用共享应用程序池并以部分信任方式运行,因此它使用一组有限的权限运行,您将遇到其他问题。

尝试在localhost中以部分信任模式重新编译/重新测试您的服务,您可能会重现此问题。

所以解决方案是:

  1. 更改您的代码,使其在Partial trust fine
  2. 中有效
  3. 用户其他托管选项(如完整的VM),您可以在其中执行您想要的所有操作(例如在完全信任中运行代码,安装身份模型程序集等等。)。