Hi Experts,
I was using the following code to connect to Dynamics CRM 2016 on-premise. It has stopped working suddenly.
ClientCredentials credentials = new ClientCredentials(); credentials.UserName.UserName = ConfigurationManager.AppSettings["Username"].ToString(); credentials.UserName.Password = ConfigurationManager.AppSettings["Password"].ToString(); string soapOrgServiceUri = ConfigurationManager.AppSettings["CRMOrgServiceUrl"].ToString(); Uri serviceUri = new Uri(soapOrgServiceUri); OrganizationServiceProxy proxy = new OrganizationServiceProxy(serviceUri, null, credentials, null); proxy.EnableProxyTypes(); service = (IOrganizationService)proxy; _client = new Microsoft.Xrm.Tooling.Connector.CrmServiceClient(proxy); return service;
CrmServiceClient object's LastCrmError property shows 'Unable to Login to Dynamics CRMOrganizationServiceProxy is null'.
How can I fix this issue?
Thanks,
Priyank