web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :

How to Connect Dataverse with Console Application

Ram Prakash Duraisamy Profile Picture Ram Prakash Duraisamy 5,593 Super User 2025 Season 2

Implementation Steps:

 

1. Open Visual Studio

 

2. Search for .Net Framework

 

rampprakash_0-1690195194751.png

 

 

3. Select Next 

 

rampprakash_2-1690195235634.png

 

4. Input your Name and Click Create

 

5. It will Create a Console Application Project

 

6. Once Created Input the Below Code

 

 

try
 {
 ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
 CrmServiceClient conn = CrmServiceClient(ConfigurationManager.ConnectionStrings["Xrm"].ConnectionString.Decrypt());
 conn = new CrmServiceClient("AuthType=Office365;Url=https://URL.crm4.dynamics.com/;Username=USERNAME;Password=PASSWORD;RequireNewInstance=True");

 if (conn.IsReady)
 {
// Connection Established
 }
else{
// Connection Not Established
}

 return conn;
 }
 catch (Exception ex)
 {
 throw;
 }

 

 

7. Once you pasted above code you will get error like below (ITS because of Missing Assembly)

 

rampprakash_3-1690195604096.png

 

 

8. Right Click on the error CRMServiceClient you will get Quick Actions Select and Select Install Package Microsoft.CrmSdk.XrmTooling.CoreAssembly

 

rampprakash_4-1690195717821.png

 

9. Once Done it will automatically install all the Respective Assembly 

 

rampprakash_5-1690195762223.png

 

 

That's it 🙂

 

Once done you are good to go with the CRM Connection and process.

 

Note:

 

We can use Client ID and Client Secret as well to establish Connection

 

 

 

 

Comments

*This post is locked for comments

  • Ram Prakash Duraisamy Profile Picture Ram Prakash Duraisamy 5,593 Super User 2025 Season 2
    Posted at
    How to Connect Dataverse with Console Application

    It's Crmserviceclient, try to search this in nugetpackage and install the same and try again

  • AbdulWahab Profile Picture AbdulWahab 517
    Posted at
    How to Connect Dataverse with Console Application

    I tried to follow it, but it is not working for me. Here is my code.

    using Microsoft.Xrm.Tooling.Connector;
    using System;
    using System.Net;
    
    namespace ConsoleApp3
    {
     class Program
     {
     static void Main(string[] args)
     {
     try
     {
     ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
     CrmServiceClient conn = CrmServiceClient(ConfigurationManager.ConnectionStrings["Xrm"].ConnectionString.Decrypt());
     conn = new CrmServiceClient("AuthType=Office365;Url=https://URL.crm4.dynamics.com/;Username=USERNAME;Password=PASSWORD;RequireNewInstance=True");
    
     if (conn.IsReady)
     {
     // Connection Established
     }
     else
     {
     // Connection Not Established
     }
    
     //return conn;
     }
     catch (Exception ex)
     {
     throw;
     }
     }
     }
    }

    I am experiencing the error below.

    AbdulWahab_0-1717076333898.png

     

  • Ram Prakash Duraisamy Profile Picture Ram Prakash Duraisamy 5,593 Super User 2025 Season 2
    Posted at
    How to Connect Dataverse with Console Application

    Hi @SebastianWalter 

     

    Yes we can use the Same too 

    Both will return response with Service with new Generated Access TOKEN

  • SebastianWalter Profile Picture SebastianWalter
    Posted at
    How to Connect Dataverse with Console Application

    Why do you not use the new Microsoft.PowerPlatform.Dataverse.Client?