CrmServiceClient Object reference not set to an instance of an object

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


Hi

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;

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

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

And Object reference not set to an instance of an object

HELP!



Source link

Leave a reply

Please enter your comment!
Please enter your name here