【问题标题】:How to fix OrganizationServiceProxy "System.ArgumentNullException: Value cannot be null. Parameter name: identityProvider" issue如何修复 OrganizationServiceProxy “System.ArgumentNullException:值不能为空。参数名称:identityProvider”问题
【发布时间】:2019-08-31 04:27:53
【问题描述】:

我正在尝试使用 OrganizationServiceProxy 从 CRM 应用程序中检索实体。它可以在我的可以访问 Internet 的 DEV 服务器上工作,但不能在没有 Internet 访问权限的测试服务器上工作。

ClientCredentials credential = new ClientCredentials();
credential.UserName.UserName = username;
credential.UserName.Password = password;
Uri uri = new Uri(serviceAddress);

OrganizationServiceProxy proxy = new OrganizationServiceProxy(uri, null, credential, null);
proxy.EnableProxyTypes();

EntityCollection entities = proxy.RetrieveMultiple(new FetchExpression(query));

测试服务器上的错误日志:

System.ArgumentNullException: Value cannot be null.
Parameter name: identityProvider
at Microsoft.Xrm.Sdk.ClientExceptionHelper.ThrowIfNull(Object parameter, String name)
at Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1.AuthenticateOnlineFederationInternal(AuthenticationCredentials authenticationCredentials)
at Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1.Authenticate(AuthenticationCredentials authenticationCredentials)
at Microsoft.Xrm.Sdk.Client.ServiceProxy`1.AuthenticateOnlineFederation()
at Microsoft.Xrm.Sdk.Client.ServiceProxy`1.AuthenticateCore()
at Microsoft.Xrm.Sdk.Client.ServiceProxy`1.ValidateAuthentication()
at Microsoft.Xrm.Sdk.Client.ServiceContextInitializer`1.Initialize(ServiceProxy`1 proxy)
at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.RetrieveMultipleCore(QueryBase query)

【问题讨论】:

  • 您在哪里运行您的应用程序?在你的机器上?
  • 您好 André,我创建了一个 Web 服务,它同时部署在 DEV 和测试服务器上。它在 DEV 服务器上运行良好,但是当我尝试在测试服务器上运行 Web 服务时会引发异常。
  • 只要您在测试服务器的主机文件中映射了 Dynamics 端点,您的 Web 服务就应该到达测试服务器的 Dynamics Web 服务。你能确认一下吗?

标签: c# dynamics-crm crm xrm xrmquery


【解决方案1】:
【解决方案2】:

我有同样的问题。防火墙阻止了一些链接。在服务器允许访问链接后,它工作了。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-08-17
    • 2018-06-03
    • 2010-11-11
    • 1970-01-01
    • 2021-10-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多