Hi
What can be possibly wrong with this code as I' trying to connect to D365 from VS Desktop C#
I'm getting this error:
CurrentAccessToken = 'svcClient.CurrentAccessToken' threw an exception of type 'System.NullReferenceException'
string connectstr =
"AuthType= 'ClientSecret';" +
"url='">OrgName.crm3.dynamics.com';" +
"ClientID='75fbd615-af9a-4d2c-b072-d78da6635189';" +
"ClientSecret='wpy8Q~Z2DimQgaYSMNC0w5kaOBcWFUsW_4Zd5aNX';";
using (CrmServiceClient svcClient = new CrmServiceClient(connectstr))
{
if (!svcClient.IsReady)
{
Console.WriteLine("unable to connect!");
return;
}
}
Hi Alaa Ramadan,
please refer the below link:-
stackoverflow.com/.../connection-to-microsoft-dynamics-365-working-in-console-app-but-not-in-web-app
Thanks,
Manoj Mane.
Please mark this as VERIFIED if it helps.
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... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156