Connect Microsoft Dynamics 365 Developer Toolkit to a Dataverse environment using Global Discovery service (deprecation of the Regional Discovery service)

Many of us use the Microsoft Dynamics 365 Developer Toolkit for plugin development. This tool helps developers avoid manual tasks and helps them focus on implementing the business logic. Unfortunately, this tool is no longer working since the switch from Regional Discovery service to the Global Discovery service. Actually, the error “FCB EnableRegionalDisco’ is disabled” is generated when connecting to the Dataverse environment.

On this blog, I will propose a workaround to solve this problem and continue to use the tool for the development and maintenance of your plugins by connecting to a Dataverse environment using the Global Discovery Service.


Before starting, this is the configuration used on my personal environment. Indeed, I use the following versions:

  • Plug-in Registration Tool version 9.0.2.7
  • Crm Sdk Bin (CoreTools) version 9.0.2.6

You can download the same versions of the SDK tools using the following PowerShell script:

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$sourceNugetExe = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
$targetNugetExe = ".\nuget.exe"
Remove-Item .\Tools Force Recurse ErrorAction Ignore
Invoke-WebRequest $sourceNugetExe OutFile $targetNugetExe
Set-Alias nuget $targetNugetExe Scope Global Verbose
##
##Download Plug-in Registration tool
##
./nuget install Microsoft.CrmSdk.XrmTooling.PluginRegistrationTool Version 9.0.2.7 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 Version 9.0.2.6 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

Also, we will need the latest version of the SDK. The PowerShell script to use is shared on the docs: https://docs.microsoft.com/en-us/powerapps/developer/data-platform/download-tools-nuget#download-tools-using-powershell

To make it easier to follow the steps, below are the two directories used:

Now it is time to go to the folder that corresponds to the Visual Studio extension of the Microsoft Dynamics 365 Developer Toolkit. In my case, this is the path used:

C:\Users\mehdi.elamri\AppData\Local\Microsoft\VisualStudio\16.0_fcaab508\Extensions\u14kvtmh.ce5

Then, we need to replace the following Dll files of the extension by those of the last version of the registration tool plugin:

  • Microsoft.Crm.Sdk.Proxy.dll
  • Microsoft.Xrm.Sdk.dll
  • Microsoft.Xrm.Tooling.Connector.dll
  • Microsoft.Xrm.Tooling.CrmConnectControl.dll
  • Microsoft.Xrm.Tooling.Ui.Styles.dll

After re-starting Visual Studio, the tool should connect smoothly to a Dataverse environment using the Global Discovery Service:


Be prepared, we are halfway there. Indeed, after being able to connect to the CRM using the Global Discovery Service. An error is generated when deploying a plugin: “Could not load file or assembly ”CrmLibraries, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference.

To resolve this issue, we need to replace the following Dll files of the Plugin registration tool used in the tool path by those of a version 8 of the registration tool:

  • CrmLibraries.dll
  • Microsoft.Xrm.Sdk.dll

You can download the version 8 on this link: https://www.microsoft.com/en-us/download/details.aspx?id=50032


Finally, after all this manipulation. I can manage to connect to a Dataverse environment and deploy my plugins with the tool while using the global discovery service. Finally, the process shared on this blog may not work for you. It depends strongly on the version of the SDK used. I highly recommend using the same version I used.

Hope it helps…


Edit: For the moment, only the connection and the deployment are functional. Indeed, the Entity class generation and the creation of a new plugin is not functional for the moment. I will edit this Blog as I can find fixes. The next step will be to fix the error generated when creating a new plugin.


Advertisement

18 thoughts on “Connect Microsoft Dynamics 365 Developer Toolkit to a Dataverse environment using Global Discovery service (deprecation of the Regional Discovery service)

  1. It stripped out my XML so add open and closing chevrons to these
    appSettings
    add key=”SkipDiscovery” value=”true”
    appSettings

    Like

    1. Hello,

      Thank you so mush for your feedback !! I don’t know if it is possible to add this configuration to the PluginRegistration.exe.config..

      Did you manage to do this?

      Thank you

      Like

  2. Hi Kokulan,

    I’m glad it worked out for you. For now, the solution is just a workaround. There are still a lot of bugs to fix…For example, I can’t generate early bound entities…Does it work for you?

    Liked by 1 person

  3. No creating early bound class from CRM Explorer pane fails as it uses the tooling connector from the folder paths we set. I do not use early bound classes much but we can generate from command line and add it to the project manually so its not a showstopper I think.

    Liked by 1 person

      1. thanks for the tip Mehdi unfortunately coping the additional dll didnt make any difference. I guess I will have to revert to using the standalone plugin registration tool and manually deploying of JS until I can spend some more time debugging this.

        Liked by 1 person

  4. Thanks really helpful blog post. The post did allow me to login and select the organisation. However, once the organisation was selected it gets stuck on the connect to CRM loading screen. Any ideas?

    I really like using the developer toolkit its just been a constant battle ever since it was first release to get it to play nicely and work with later versions of Visual Studio.

    Like

      1. Thanks Mehdi I tried but still have the same issue. Can I confirm what DLL’s you copy is it the ones from the latest SDK on the MS site powershell or the specific version you download in the blog. I maybe misunderstanding but it seems your downloading the same thing twice?

        Liked by 1 person

  5. ok so Ive got little bit further than before I get an error “Target invocation error” and it freezes but it does say “Connection to Microsoft Common Data Service Complete”

    Liked by 1 person

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s