Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

CrmServiceClient Object reference not set to an instance of an object

$
0
0

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!


Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images