Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

New CRM Connection code causing errors

$
0
0

I am trying to create a console application that connects to CRM 2016 (On Prem) using the 2016 SDK.

The below code fails. The conn.LastCrmError has the following details and the orgService is null.

Unable to Login to Dynamics CRMOrganizationWebProxyClient is null OrganizationServiceProxy is null OrganizationWebProxyClient is null OrganizationServiceProxy is null.

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;

The connection works I run old code below using the 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());

Any suggestions on how to resolve this?



Viewing all articles
Browse latest Browse all 8223

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>