[SOLVED] Connection to Dynamics 365 Customer Engagement Error


Introduction:

After switching to Dynamics 365 Customer Engagement V 9.0 many of us are getting an error while trying to connect with the system using code. Here we will see how to connect to Dynamics 365 using a Console app in v8.2 and when the same code is used to connect to version 9 we get an error. We will also discuss about how to resolve the issue.

Implementation:


Step 1: The code shown below is used to connect to Dynamics 365 version 8.2 using Console App
Connect to CRM Code
Below is the ConnectToCRM function
Connect to CRM Code

Step 2: When we run the above code, we get the following output
Successful Connection


Step 3: Now we change the credentials and try connecting to Dynamics 365 V9 with the same code we get the following error

Error Connecting to Dynamics 365 Customer Engagement



Step 4: To solve this issue there are two ways in the first method, set the Target framework to “.NET Framework 4.6.2 or above”.
Visual Studio Target Framework Setup

Step 5: After changing the target version build the solution again and run the app and the connection to Dynamics 365 version 9 environment will be successful.

Step 6: The second method is by using the below code before making a connection.
Addition Security Protocol Code for Dynamics 365 V9.0


Here TLS stands for “Transport Layer Security,” and is a protocol that is an industry standard designed to protect the privacy of information communicated over the Internet. 

Hope this helped!

Comments

  1. This comment has been removed by the author.

    ReplyDelete

Post a Comment

Popular posts from this blog

Run Workflow directly from a button in Dynamics 365 Customer Engagement V9.0

Create and Associate Records in a single operation using Xrm.WebAPI in D365 Customer Engagement

Use Audit Logs in Dynamics 365 : Actionable Audit