Friday, September 15, 2017

Textual description of firstImageUrl

Unable to Login to Dynamics CRMOrganizationServiceProxy is null

Dlls Required:

CRM connection code:
string connectionString = ConfigurationManager.ConnectionStrings["CRM"].ConnectionString;

CrmServiceClient client = new CrmServiceClient(connectionString);

Connection String:
<add name="CRM" connectionString="AuthType=Office365;; Password=mypassword;Url="/>

That’s it, this is the piece of code required to connect CRM online through SDK. But the error "Unable to Login to Dynamics CRMOrganizationServiceProxy is null" sometimes can kill good amount of time. Below are the some suggestion which can resolve and saves someone's hours of time.

1. Check your connection string.
2. You should use unique name of organization in connection string. You can find unique name in              Settings->Customizations->Developer Resources

3. something wrong with credentials you are using. Try using service credentials.
4. Double check which version of dlls you are using.
5. Install the right version of dlls through nuget packages

6. There may something wrong with network, try using different network preferably try to test in client network itself
7.     And, include below tag in app.config or web.config
  <defaultProxy useDefaultCredentials="true"></defaultProxy>

Let me know which point helps you most.

Happy coding.


  1. Hi Ravi Vakalpudi.

    I did the same thing but i am facing the same problem still..

    "Unable to Login to Dynamics CRMOrganizationServiceProxy is null"

    "Error while connecting to crm Metadata contains a reference that cannot be resolved.

    and my online CRM version is 9.2 and sdk dll version is 9.

    Please help..

  2. Please add this line to your code before connect to CRM.

    ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072; // add ref System.Net dll


  3. Hi Nissee...

    Thank You very much... Its worked..


  4. Amazing, same works for me!

  5. Hi Nissee,

    Thanks. This works magic.

  6. It is really a great work and the way in which you are sharing the knowledge is excellent.Thanks for your informative article

    software testing course in chennai

  7. Hi! It worked, thx for the help. However I dont understand why do we have to change SecurityProtocol. It is kind of missing from the MSD. Do you know the reason why this change is necessary? (other than that it works)

  8. For Powershell. Here you go.

    #V9 requires new security protocol in order to connect
    # reference:
    [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12

  9. HI
    I tried with ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072, but it does not work for me.
    The server were the client app is installed have Windows Server 2008 R2 SP1 and .NetFramework 4.6.2.

    Do you have any other idea?

    Thanks in advance

  10. Thanks for the great information , i was looking for this information from long.Great blog
    tally course in hyderabad