1
正嘗試使用2016 SDK創建連接到CRM 2016(On Prem)的控制檯應用程序。導致錯誤的新CRM連接代碼
下面的代碼失敗。 conn.LastCrmError具有以下詳細信息,並且orgService爲null。
無法登錄Dynamics CRMOrganizationWebProxyClient爲null OrganizationServiceProxy爲null OrganizationWebProxyClient爲null OrganizationServiceProxy爲null。運行時的舊代碼,下面,使用2015年SDK
var connectionString = @"Url=http://wxxxxx/xxxx/; Username=xxxxx; Password=xxxxx;";
IOrganizationService orgService2 = new OrganizationService(CrmConnection.Parse(connectionString));
var results = orgService2.Execute(new WhoAmIRequest());
就如何解決這個任何建議
var connectionString = @"Url=http://xxxx/xxxx/; Username=xxxx; Password=xxxx;";
CrmServiceClient conn = new CrmServiceClient(connectionString);
IOrganizationService orgService = conn.OrganizationWebProxyClient != null ? (IOrganizationService)conn.OrganizationWebProxyClient : (IOrganizationService)conn.OrganizationServiceProxy;
連接正常?