Getting started with Dynamics 365 CRM SDK in C#

2019-01-14 | apurvghai | Dynamics CRM SDK | C#


Getting started with CRM SDK has been this simple. CRM now offers you variety of options to connect with. You can choose between XRM Tooling Connector, Standard Core assemblies, or simply use OAuth with Web API. This article will talk about CRM SDK using late binding approach.

CRM Tooling Connector

Tooling connector is the easiest form of SDK and is very simple to implement. Let’s see how to use it

  • Create a visual studio console application project in Csharp
  • Use the nuget manager to restore Xrm tooling connector. See sample if you are not sure on how to use nuget.
  • Write the following code

cons string Url = "https://demo.crm.dynamics.com";
cons string Username = "user@domain.onmicrosoft.com"; //You can use federated too
cons string Password = "*********"
var connectionString = $"Url={Url}; Username={Username}; Password={Password}; 
     AuthType=Office365";
var client = new CrmServiceClient(connectionString);
if(client.IsReady) {
    Console.Log("Your connection has been established");
}
else {
    Console.Log("An error ocurred");
}

You can review the list of connection string available in this document.


Recent Posts
Getting started with Dynamics 365 CRM SDK in C#
Jan 14, 19 | Dynamics CRM SDK
Using Postman with Dynamics 365 Online and OnPremise
Jan 14, 19 | Dynamics CRM SDK
Getting Started with WebAPI
Dec 28, 18 | Dynamics CRM SDK