Unable to Connect Dynamics CRM OrganizationWebProxyURL is null

While connecting Dynamics 365, to be Specific 9.0 using Following code of Console

**For Connecting CRM Via Console App, Find my Blog Here

Application, you will not be able connect to CRM
You will get Following Error in Log.
Unable to Connect Dynamics CRM OrganizationWebProxyURL is null.

01.png

 

This Behavior of CRM is Because of New feature of CRM 9.0
you Can read here

https://docs.microsoft.com/en-us/dynamics365/get-started/whats-new/customer-engagement/new-in-version-9-for-developers#security-updates-may-require-update-to-custom-client-applications

 

Starting with Dynamics 365 (online), version 9.0 we will begin requiring connections to customer engagement applications to utilize TLS 1.2 (or better) security.

 

To Solve the Issue,
Step 1 :  Add Following NameSpace

using System.Net;

Step 2 : Add Following Line Before Connecting to CRM.

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

 

This will enable TLS 1.2 for your Connection and Now you can see CRM connecting via Console.

 

Basically the workaround is to directly assign the port for TLS 1.2.

 

To Learn more about TLS1.2, Check this Link : https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/dd560644(v=ws.10)

 

Final code :

using Microsoft.Xrm.Tooling.Connector;
using System;
using System.Configuration;
using System.Net;

namespace QueryExpression01
{
class Program
{
static void Main(string[] args)
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
#region Connect To CRM in just one lines
CrmServiceClient Crmconn = new CrmServiceClient(ConfigurationManager.ConnectionStrings[“CrmOnlineUrl”].ConnectionString);
#endregion
if (!Crmconn.IsReady)
{
Console.WriteLine(“No Connection was Made.”);
return;
}
}
}
}

4 thoughts on “Unable to Connect Dynamics CRM OrganizationWebProxyURL is null

  1. Also make sure that xrm.sdk.dll should be of Version 8.0 not of 9.0.
    Otherwise it will give the same error.

    Like

  2. I was able to get it to work with Claims Based and IFD disabled but when enabled and going through Okta it fails to connect to services. Suggestions?

    Like

Leave a comment