2

I'm trying to use Microsoft's Dynamics CRM API helper code to connect to an Azure CRM instance and query some entities. The code is in package Microsoft.Crm.Sdk.Samples.HelperCode.

However, the helper code provided by Microsoft fails to compile.

Here are the errors:

MicroFail

Has anyone managed to solve this problem?

Mark Micallef
  • 2,643
  • 7
  • 28
  • 36
  • Can you paste the error message instead of image, that will help to search & find this similar problem in future. If you find the answer helpful, pls upvote/mark it to encourage community volunteers.. – Arun Vinoth-Precog Tech - MVP Dec 07 '18 at 12:56

1 Answers1

1

Probably the old project using ADAL 2.x old version but conflicting with latest ADAL 3.x version in your system.

AuthenticationResult authenticationResult = authenticationContext.AcquireToken(organizationUrl, clientcred);

Change the above line like below:

AuthenticationResult authenticationResult = authenticationContext.AcquireTokenAsync(ClientConfig.CRMOrgUrl, clientcred).Result;

Reference