Mark Micallef
Mark Micallef

Reputation: 2798

Microsoft.Crm.Sdk.Samples.HelperCode does not compile

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?

Upvotes: 2

Views: 104

Answers (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

Upvotes: 1

Related Questions