I have written following code while trying to create a proxy of Organization service in my .NET console app:
IOrganizationService _orgService;
CrmServiceClient crmConn = new CrmServiceClient(ConfigurationManager.ConnectionStrings["TestConnectionString"].ConnectionString);
_orgService = (IOrganizationService)crmConn.OrganizationWebProxyClient != null ? (IOrganizationService)crmConn.OrganizationWebProxyClient : (IOrganizationService)crmConn.OrganizationServiceProxy;
While debugging it is showing an error saying "
Unable to Login to Dynamics CRMOrganizationWebProxyClient is null OrganizationServiceProxy is null OrganizationWebProxyClient is null OrganizationServiceProxy is null.
Following is the connections string
<add name="TestConnectionString" connectionString="Url=https://######.api.crm4.dynamics.com/XRMServices/2011/Organization.svc; Username=######@####.com; Password=#######; Authtype=Office365" />
I have tried playing around with the URL in connection string, but nothing has worked till now.
I can use the same code and Dynamics 365 connection string to connect to Dynamics 365 instance, but it is not working for CRM Online 2016.
Note: We are using Microsoft Dynamics CRM Online 2016 licence, and are logging into CRM through Office 365 accounts.
Any help on this will be much appreciated
thanks
<connectionStrings> <add name="TestConnectionString" connectionString="Url=https://abc.crm.dynamics.com; [email protected]; Password=xxxxxx"/> </connectionStrings>
– dynamicallyCRM