Home
Softono

Dynamics365ConsoleCaller

Open source C#
38
Stars
8
Forks
1
Issues
0
Watchers
3 years
Last Commit

 About Dynamics365ConsoleCaller

Boilerplate code for testing Dynamics 365 / CRM code locally

Platforms

Web Self-hosted Windows

Languages

C#

Need Help Installing Dynamics365ConsoleCaller?

We provide expert installation service for this software. Our team will install, configure, and secure Dynamics365ConsoleCaller on your server. plans start at just $30.

Dynamics365ConsoleCaller

View on GitHub

This code has been written with only intention to save developer's time while testing Dynamics 365 code which requires connection to CRM organization & IOrganizationService and/or ITracingService instances.

To use it just download this project, open in Visual Studio and build to restore nugget packages, open Program.cs(below code) and provide credentials/client secret to GetOrganizationService method

class Program
{
    static void Main(string[] args)
    {
        IOrganizationService orgService;
        // Option 1 : Connect using Client Secret
        orgService = Connect.GetOrganizationServiceClientSecret(
             "<Client Id obtained from Azure AD App>",
             "<Client Secret obtained from Azure AD App>",
             "<Organization Uri>");

        // Option 2 : Connect using Password
        orgService = Connect.GetOrganizationService(
             "<UserID>@<OrganizationName>.onmicrosoft.com",
             "<Your Crush's Name i.e. Your Password>",
             "<CRM login URI>");
 
        Console.WriteLine("Connected to Organization Service!");

        ITracingService tracingService = Connect.GetTracingService("AshV_Log");

        // Write Your Testing Code here.

        var response = orgService.Execute(new WhoAmIRequest());
    }
}
  • To test code snippet just write/paste your code at mentioned place and simply run/debug.

  • You can even add references to DLLs in this project and call public methods.