CrmServiceClient Object reference not set to an instance of an object

Forum Post: Change the Filter On option on Opportunity Associated View for Account form


I’ve been trying to change to oAuth since my connections started to fail today.
I’ve used what I’ve seen on the net but it’s not working.

M previous code was;

        ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
        CrmServiceClient service = new CrmServiceClient(ConfigurationManager.ConnectionStrings["CRMLIVE"].ConnectionString);

And Ive changed to use a new conncegion string like

            CrmServiceClient service = new CrmServiceClient(ConfigurationManager.ConnectionStrings["CrmConnectionString"].ConnectionString);

In my web.config i have the string;

<add name="CrmConnectionString" connectionString="AuthType=OAuth;Username=; Password=xxxx;Url=;AppId=51f81489-12ee-4a9e-aaae-a2591f45987d; RedirectUri=app://58145B91-0C36-4500-8554-080854F2AC97;LoginPrompt=Never"/>

It’s not working. LastCRMerror is Unable to Login to Dynamics CRM

And Object reference not set to an instance of an object


Source link

Leave a reply

Please enter your comment!
Please enter your name here