Migrating apps from Microsoft.Xrm.Client to Microsoft.Xrm.Tooling

Today I had a task to migrate couple of apps that used Microsoft.Xrm.Client assemblies to new Tooling assemblies. In this article I will describe steps to use to migrate your own apps to use latest (and recommended) tools to connect to your CRM Instances from code.

Let’s assume that we have an application that uses Microsoft.Xrm.Client assembly to connect to CRM and it stores connection string to CRM in app.config file as it shown on following screenshots:



Also I assumed that NuGet (and not your local hard drive) was as a source for referenced assemblies. To start migration open “Manage NuGet Pakages…” dialog:


Update (if it is required) SDK assemblies to use latest versions available:


Uninstall Microsoft.CrmSdk.Extension package:


Install latest tooling package:


After all operations list of your NuGet packages should look like following:


Following change should be applied to code – removal of references to namespaces Microsoft.Xrm.Client and Microsoft.Xrm.Client.Services and changing of code for getting of service instance from


with adding of reference to Microsoft.Xrm.Tooling.Connector namespace.

Don’t forget to change your connection string according to this article.

If your code throws exception like

An unhandled exception of type ‘System.TypeLoadException’ occurred in Microsoft.Xrm.Tooling.Connector.dll Additional information: Could not load type ‘Microsoft.IdentityModel.Clients.ActiveDirectory.PromptBehavior’ from assembly ‘Microsoft.IdentityModel.Clients.ActiveDirectory, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35’.

open installed NuGet packages and downgrade Microsoft.IndentityModel.Client.ActiveDirectory to 2.28.3 version:


After that your code should work fine:



  1. Hi Andrii,

    I would add one check in your code. Once you created the CrmServiceClient instance, check the IsReady property. If the connection failed for any reason, only this property can tell you that the connection is not established

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.