Hi Guys,
I'm using the code below to get organization service, it can get service, but now it sometimes show "System.ServiceModel.CommunicationException: The underlying connection was closed: A connection that was expected to be kept alive was closed by the server." when I invoke this service. I'm not sure if it's because I didn't explicitly use TLS1.2(ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; ).
I'm using Dynamics crm 9.0 on-premise version.
Thanks,
Dejun
System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate (object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return true; };
_service = (IOrganizationService)new OrganizationServiceProxy(new Uri(ConfigurationManager.AppSettings["CRMUrl"]),
null, _clientCredentials, null);
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,522 Super User 2024 Season 2
Martin Dráb 228,441 Most Valuable Professional
nmaenpaa 101,148