We are migration our CRM 2016 from onprem to CRM Online using Fast Track from Microsoft.
One of our services in one of our production server had the following problem, when trying to connect to Microsoft.Xrm.Tooling.Connector.CrmService:
One or more errors occurred. => An error occurred while sending the request. => The underlying connection was closed: An unexpected error occurred on a send. => Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. => An existing connection was forcibly closed by the remote hostERROR REQUESTING Token FROM THE Authentication context - General ADAL Error
One or more errors occurred. => An error occurred while sending the request. => The underlying connection was closed: An unexpected error occurred on a send. => Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. => An existing connection was forcibly closed by the remote hostOne or more errors occurred. => An error occurred while sending the request. => The underlying connection was closed: An unexpected error occurred on a send. => Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. => An existing connection was forcibly closed by the remote hostUnable to connect to CRM: An error occurred while sending the request.
One or more errors occurred. => An error occurred while sending the request. => The underlying connection was closed: An unexpected error occurred on a send. => Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. => An existing connection was forcibly closed by the remote hostUnable to Login to Dynamics CRM
Unable to Login to Dynamics CRMOrganizationWebProxyClient is null
OrganizationWebProxyClient is null
We didn't got this problem in development machines environment, not in testing machines environment.
Has anyone got this erro before?
Thanks.
Hi, after openning a case with Microsoft support we found the problem.
We were getting this error on the production machine becausa it was using TLS 1.0, the problem was resoulve when we force the usage of TLS 1.2 (yellow part):
var connectionString = "authtype=ClientSecret;url=example.crm4.dynamics.com/;clientid=<guid>;ClientSecret=<secret>";
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
CrmServiceClient conn = new Microsoft.Xrm.Tooling.Connector.CrmServiceClient(connectionString);
var service = (IOrganizationService)conn.OrganizationWebProxyClient != null ? (IOrganizationService)conn.OrganizationWebProxyClient : (IOrganizationService)conn.OrganizationServiceProxy;
if (service == null)
{
Console.WriteLine($"Error getting IOrganizationService-{conn?.LastCrmError}");
throw new Exception("Error getting IOrganizationService.");
}
More info:
probably has to do with the package version and the authentication.
Update to the latest SDK and use an authentication method like clientid/clientsecret (office365 authentication with username/password is not supported)
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,524 Super User 2024 Season 2
Martin Dráb 228,469 Most Valuable Professional
nmaenpaa 101,148