Download CRM 365 V9.X Tools using PowerShell

Follow the below steps to download the Tools,

Step 1: Create a folder in D Drive and name it as “Dynamics_365_Development_Tools

Step 2: Click on Windows, search for Windows PowerShell and open it.

Windows Powershell

Step 3: Type the below command to change the directory.

cd D:\Dynamics_365_Development_Tools

and press Enter.

Windows Powershell Command to Change Directory

Step 4: Copy & Paste the below PowerShell script in PowerShell Window to download tools from Nuget.

$sourceNugetExe = ""
$targetNugetExe = ".\nuget.exe"
Remove-Item .\Tools -Force -Recurse -ErrorAction Ignore
Invoke-WebRequest $sourceNugetExe -OutFile $targetNugetExe
Set-Alias nuget $targetNugetExe -Scope Global -Verbose

##Download Plugin Registration Tool
./nuget install Microsoft.CrmSdk.XrmTooling.PluginRegistrationTool -O .\Tools
md .\Tools\PluginRegistration
$prtFolder = Get-ChildItem ./Tools | Where-Object {$_.Name -match 'Microsoft.CrmSdk.XrmTooling.PluginRegistrationTool.'}
move .\Tools\$prtFolder\tools\*.* .\Tools\PluginRegistration
Remove-Item .\Tools\$prtFolder -Force -Recurse

##Download CoreTools
./nuget install Microsoft.CrmSdk.CoreTools -O .\Tools
md .\Tools\CoreTools
$coreToolsFolder = Get-ChildItem ./Tools | Where-Object {$_.Name -match 'Microsoft.CrmSdk.CoreTools.'}
move .\Tools\$coreToolsFolder\content\bin\coretools\*.* .\Tools\CoreTools
Remove-Item .\Tools\$coreToolsFolder -Force -Recurse

##Download Configuration Migration
./nuget install Microsoft.CrmSdk.XrmTooling.ConfigurationMigration.Wpf -O .\Tools
md .\Tools\ConfigurationMigration
$configMigFolder = Get-ChildItem ./Tools | Where-Object {$_.Name -match 'Microsoft.CrmSdk.XrmTooling.ConfigurationMigration.Wpf.'}
move .\Tools\$configMigFolder\tools\*.* .\Tools\ConfigurationMigration
Remove-Item .\Tools\$configMigFolder -Force -Recurse

##Download Package Deployer 
./nuget install Microsoft.CrmSdk.XrmTooling.PackageDeployment.WPF -O .\Tools
md .\Tools\PackageDeployment
$pdFolder = Get-ChildItem ./Tools | Where-Object {$_.Name -match 'Microsoft.CrmSdk.XrmTooling.PackageDeployment.Wpf.'}
move .\Tools\$pdFolder\tools\*.* .\Tools\PackageDeployment
Remove-Item .\Tools\$pdFolder -Force -Recurse

##Remove NuGet.exe
Remove-Item nuget.exe

Press Enter.

Step 5: Below Tools will be downloaded to D:\Dynamics_365_Development_Tools\Tools Folder.

Development Tools

To get the latest version of these tools, repeat these steps.

Hope you have successfully downloaded Tools from NuGet using Powershell script :):):)


Visual Studio and the .NET Framework for Dynamics 365 CRM Online V9.X

The .NET SDK assemblies for Dynamics 365 (online) are built on .NET Framework 4.5.2.

You can use Visual Studio to build your managed code applications using .NET Framework 4.5.2 or later.


You should build any custom client applications using Microsoft .NET Framework 4.6.2 or later. Starting with the Dynamics 365 (online), version 9.0, only applications using Transport Level Security (TLS) 1.2 or better security will be allowed to connect. TLS 1.2 is not the default protocol used by .NET Framework 4.5.2, but it is in .NET Framework 4.6.2.

Enforcement of this higher standard for security will only be applied to Dynamics 365 (online), version 9.0 at this time. If your clients are designed to connect to any version or deployment type you can prepare by re-compiling the application to use .NET Framework 4.6.2. 


When installing .NET Framework 4.6.2 on your development computer, be sure to install the developer pack and not just the run-time. This will enable the 4.6.2 framework to be chosen in the New Project dialog box of Visual Studio and in the target framework drop-down menu of the project’s properties.

You can use a Visual Studio Community edition for development.

Step by Step to connect Dynamics 365 CRM Online V9.X using C# Console Application

Follow the below steps,

Step 1: Open Visual Studio and Click on New Project. Click on Visual C# and select Console Application.

Give Name to the Project and click on OK.

Connect to Dynamics 365 Online - Step1 Open Visual Studio

Step 2: Goto Visual Studio Tools -> NuGet Package Manager and click on Package Manger Console.

Connect to Dynamics 365 Online - Step2 Open Package Manager Console

Step 3: In Package Manager Console, Copy & Paste the below command to get the required CRM SDK Dlls and press Enter.

Click here to know the Latest version of the CRM Dlls.

Install-Package Microsoft.CrmSdk.CoreTools -Version

Connect to Dynamics 365 Online - Step3 Install CRM SDK Core Tools

Step 4: Latest CRM SDK Dlls are installed in the project’s bin\coretools folder. You can also see the success message in Package Manager Console.

Connect to Dynamics 365 Online - Step4 Add CRM SDK Core Tools to VS Project

Step 5: Right Click on References and navigate to bin\coretools folder.

Add the below Dlls to the Visual Studio project.



Connect to Dynamics 365 Online - Step5 Add CRM and Xrm SDK Dlls

And also add the below and click on OK,



Connect to Dynamics 365 Online - Step5 Add Runtime and Service Model References

Step 6: Add the below namespaces.

using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Client;
using Microsoft.Crm.Sdk.Messages;
using System.Net;
using System.ServiceModel.Description;

Connect to Dynamics 365 Online - Step6 Add Namespaces

Step 7: Copy and Paste the below Code in Main method.

IOrganizationService organizationService = null;

 ClientCredentials clientCredentials = new ClientCredentials();
 clientCredentials.UserName.UserName = "<ProvideUserName>@<ProvideYourOrgName>";
 clientCredentials.UserName.Password = "<ProvideYourPassword>";

// For Dynamics 365 Customer Engagement V9.X, set Security Protocol as TLS12
 ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
// Get the URL from CRM, Navigate to Settings -> Customizations -> Developer Resources
// Copy and Paste Organization Service Endpoint Address URL
organizationService = (IOrganizationService)new OrganizationServiceProxy(new Uri("https://<ProvideYourOrgName>.api.<CRMRegion>"),
 null, clientCredentials, null);

if (organizationService != null)
 Guid userid = ((WhoAmIResponse)organizationService.Execute(new WhoAmIRequest())).UserId;

if (userid != Guid.Empty)
 Console.WriteLine("Connection Established Successfully...");
 Console.WriteLine("Failed to Established Connection!!!");
 catch (Exception ex)
 Console.WriteLine("Exception caught - " + ex.Message); 

Step 8: Right click on the solution and build it. If build is succeeded, Run the application to see the below Message.

Connect to Dynamics 365 Online - Success Message


Problem: If you face any build issues like the below, while building the project, then use the below solution and resolve it.

Connect to Dynamics 365 Online - Step8 Build issues

Solution: Follow the below steps to resolve the problem.

  1. Change the Project’s Dot Net Framework from 4.5 to 4.5.2, this change is required because latest CRM SDK Dlls needs the 4.5.2 version of Dot Net Framework.

Connect to Dynamics 365 Online - .Net Framework 4.5.2

2. Click on Yes and build the project.

Connect to Dynamics 365 Online - Target Framework Change Message

For more info Click here.

Hope you have successfully connected to Dynamics CRM Online Version 9.X :):):)

Metadata contains a reference that cannot be resolved: ‘’ error in Dynamics 365

Part 3 – Connecting Dynamics with Blockchain

Manny Grewal

If you have been following along the blog series, you’ve seen in Part 1 why blockchain matters and in Part2 how we can build a shopping cart in ReactJs that will be used in this part to send our transactions to the blockchain. In this part, we will see the blockchain plumbing and setup.

Audience: If you are functional consultant or an architect who wants to understand how blockchain transactions work (at a high level). I have explained them in the Blockchain Request Lifecycle section. If you are developer who would like to build something similar, I have also posted the source code of my working prototype that demonstrates how Dynamics can be linked to the blockchain. I have never heard of blockchain in Dynamics365 space, so potentially this the first ever working prototype with source code – hooray!!

There are few blockchains in the market but the two…

View original post 809 more words

Blockchain Part 2 – ReactJs portal for Dynamics 365

Manny Grewal

Continuing our journey down the chain as you can see in the architecture diagram I shared in my previous post NodeJs (the green patch) is our middleware that makes the commuicaiton possible. As of now Dynamics offers no direct connection to any blockchain. Let alone direct connection, there are not even any connector available. See that’s the joy of working on the cutting edge – you get to invent. Necessity is the mother of invention. So I thought of building some kind of middleware and NodeJs was a great choice as it will broker the communication between Dynamics, Portal and the blockchain.

The following are the main roles of the NodeJs layer in this architecture

Retrieving and storing information into Dynamics using Web API

For this I had to register my application inside the Azure AD as a native app.

Module Bundling

I used Webpack 3.0 as my module bundler…

View original post 611 more words

Blockchain integration with Dynamics 365

Manny Grewal

“2017 is the year of Machine Learning, 2018 will be the year of Blockchain. So get ready to chain your CRM to the block”

Manny Grewal

What a great way to start a blog series with a quote of your own. Last year I blogged at length how machine learning can take your CRM implementations to the next level and demonstrated some real world use cases of how artificial intelligence can weave its magic. This year I thought why not explore the other great things buzzing around and the exploration left me amazed!!  Not because I learnt lot of amazing things but at the amount of untapped potential which we are missing upon. Technology paradigms are changing rapidly and being a technologist feels like running after multiple buses departing away from you in opposing directions. If you run after one, you’ll miss the other.


This is what happened when…

View original post 616 more words