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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Unanswered

How to deploy manually the newer version of CRM SDK on premise to skip Regional Discovery Service (RDS) validation error

(2) ShareShare
ReportReport
Posted on by

*** UPDATED 11 June 2021 *** Version 2

 

NOTE: PLEASE USE A TEST ENVIRONMENT FIRST AND TAKE NOTE OF THE STEPS. These are just 5 simple steps to manually enable a different version of XRM SDK that would skip URL validation through Regional Discovery Service and fall back to Global Discover Service.

 

PRE-REQUISITE:

You must have installed .NET 4.6.2 or a later .NET Framework version before moving forward with the following

LINK Download Microsoft .NET Framework 4.6.2 (programma di installazione offline) per Windows 7 SP1, Windows 8.1, Windows 10, Windows 10 November Update, Windows Server 2008 R2 SP1, Windows Server 2012 e Windows Server 2012 R2 from Official Microsoft Download Center

Below one of the typical errors that you might receive when deploying the new CRM SDK without installing .NET 4.6.2

pastedimage1623738214685v1.png 

(1) Download the CRM SDK package (it will download a nupkg file): Microsoft.CrmSdk.CoreTools

https://www.nuget.org/packages/Microsoft.CrmSdk.CoreTools/9.0.2.11

IMPORTANT: When you have downloaded nupkg file be sure to UNBLOCK it

 

pastedimage1623427299988v1.png

(2) Rename the file extension to .zip and unzip the file to a folder. The files we’re interested in are the dlls in content\bin\coretools folder.

(3) Stop NST 

 

(4) Pull 

Microsoft.Crm.Sdk.Proxy.dll

Microsoft.Xrm.Sdk.Deployment.dll

Microsoft.Xrm.Sdk.dll

Microsoft.Xrm.Tooling.Connector.dll

and copy them over the older versions in the NST folder (make a backup of the older versions of these DLLs of course) and also RTC folder (needed only in dev clients to run New-NAVCRMTable runs and finsql.exe compilations where these assemblies are referenced)

 

NST folders:

C:\Program Files\Microsoft Dynamics 365 Business Central\<version>\Service\DataSources\XrmV9

C:\Program Files\Microsoft Dynamics NAV<version>\Service

Client folders:

C:\Program Files (x86)\Microsoft Dynamics 365 Business Central\<version>\RoleTailored Client

C:\Program Files (x86)\Microsoft Dynamics NAV\<version>\RoleTailored Client

NOTE: Pulling or replacing the DLL files in the Windows Client folder is only needed to run the New-NavCRTable cmdlet and/or to compile objects within CSIDE. This is typically done by developers using test workstations or workstations dedicated to develop code. These steps are not necessary to be done on end users workstations.

 

(5) In the following 3 config files

 

C:\Program Files\Microsoft Dynamics NAV\<version>\Service\Microsoft.Dynamics.Nav.Server.exe.config

C:\Program Files (x86)\Microsoft Dynamics NAV\<version>\RoleTailored Client\Microsoft.Dynamics.Nav.Client.exe.config

C:\Program Files (x86)\Microsoft Dynamics NAV\<version>\RoleTailored Client\Finsql.exe.config

 

add or change the following to the assemblyBindings:

<dependentAssembly>

 

         <assemblyIdentity name="Microsoft.Xrm.Sdk" publicKeyToken="31bf3856ad364e35"/>

 

          <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0"/>

 

</dependentAssembly>

<dependentAssembly>

 

         <assemblyIdentity name="Microsoft.Xrm.Tooling.Connector" publicKeyToken="31bf3856ad364e35"/>

 

          <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>

 

</dependentAssembly>

NOTE: Changing client side config files in RTC folder (Microsoft.Dynamics.Nav.Client.exe.config and finsql.exe.config) is only needed to run the New-NavCRTable cmdlet and/or to compile objects within CSIDE. This is typically done by developers using test workstations or workstations dedicated to develop code. These steps are not necessary to be done on end users workstations.

 

(6) Restart NST

(7)  These 2 object may fail to load or compile because they are looking for different SDK version, then open TAB5330.TXT and COD5330.TXT in designer and change explicit references to .NET CRM Assemblies version 8 to be completely without a version like e.g. in Release notes for NAV 2018

https://docs.microsoft.com/en-us/dynamics-nav/d365-sales-modifications-for-upgrade?branch=crm-technical-upgrade

 

Change:

DotNet "'Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.<class/type>"

To:

DotNet "'Microsoft.Xrm.Sdk'.<class/type>”

Change:

DotNet 'Microsoft.Xrm.Tooling.Connector, Version=2.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.<class/type>”

To:

DotNet "'Microsoft.Xrm.Tooling.Connector'.<class/type>”

 

Save and successfully compile  TAB5330.TXT and COD5330.TXT

NOTE: This step MAY not be required with version 13.x or 14.x or higher since these versions comes with TAB5330 and COD5330 with assemblies already declared without version

NOTE: You must have a valid development license to perform this task

(8) Run the client and test connection once again. It should be successful.

I have the same question (0)
  • Maksym Profile Picture
    10 on at

    Good day,

    I have tested CRM conenction using Oauth from NAV 2018 (build 11.0.47294) and it works fine without issues (as promised)

    My Customer is using NAV 2017 and I have to make it work....

    I have used Dynamics NAV 2017 10.0.30563 (latest build, June 2021).

    NuGet libraries 9.0.2.11

    Everything was done according this manual.

    The list of dlls:

    Microsoft.Crm.Sdk.Proxy.dll (not listed) 9.0.37.948

    Microsoft.Xrm.Sdk.Deployment.dll 9.1.0.1122

    Microsoft.Xrm.Sdk.dll 9.037.948

    Microsoft.Xrm.Tooling.Connector.dll 3.0.0.973

    Client Config:

                <dependentAssembly>
                    <assemblyIdentity name="Microsoft.Xrm.Sdk" publicKeyToken="31bf3856ad364e35"/>
                    <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0"/>
                </dependentAssembly>
                <dependentAssembly>
                    <assemblyIdentity name="Microsoft.Xrm.Tooling.Connector" publicKeyToken="31bf3856ad364e35"/>
                    <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="3.0.0.0"/>
                </dependentAssembly>
                <dependentAssembly>
                     <assemblyIdentity name="Microsoft.Xrm.Sdk.Deployment" publicKeyToken="31bf3856ad364e35"/>
                    <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0"/>
                </dependentAssembly>

    Server Config:

          <dependentAssembly>
             <assemblyIdentity name="Microsoft.Xrm.Sdk" publicKeyToken="31bf3856ad364e35"/>
             <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0"/>
          </dependentAssembly>
          <dependentAssembly>
             <assemblyIdentity name="Microsoft.Xrm.Tooling.Connector" publicKeyToken="31bf3856ad364e35"/>
             <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
          </dependentAssembly>
          <dependentAssembly>
             <assemblyIdentity name="Microsoft.Xrm.Sdk.Deployment" publicKeyToken="31bf3856ad364e35"/>
             <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0"/>
          </dependentAssembly>

    Connection doesn't work  (on test connection)!!!

    Microsoft Dynamics NAV
    ---------------------------

    The connection setup cannot be validated. Verify the settings and try again.
    Detailed error description: Unable to cast object of type 'Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.InteractiveWebUI' to type 'Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.IWebUI'..
    ---------------------------
    OK
    ---------------------------

    Additionally, after changing refrences CRMHelper is not accesible by NAV :

    [TryFunction] ImportDefaultCRMSolution(..)

    CRMHelper.ImportDefaultCrmSolution(OrganizationServiceProxy);

    [TryFunction] InitializeCRMConnection

    OrganizationServiceProxy := CRMHelper.InitializeServiceProxy(URI,HomeRealmURI,ClientCredentials);

    with the following errors (here is nor such reference)

    ---------------------------
    Microsoft Dynamics NAV Development Environment
    ---------------------------
    .NET interop: exception occurred, 'Could not load file or assembly 'Microsoft.Xrm.Sdk, 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. (Exception from HRESULT: 0x80131040)'.
    ---------------------------
    OK   
    ---------------------------

    ---------------------------
    Microsoft Dynamics NAV Development Environment
    ---------------------------
    A maximum of 0 parameters must be used when calling the function. For example:

    MyFunc( .. , .. , .. )
    ROUND(MyVar)
    ROUND(MyVar,0.05)
    ---------------------------
    OK   
    ---------------------------

    Thus, could you please advise how to resolve this issue?

    Thank you in advance.

  • THE Italian Profile Picture
    on at

    Please open a request to support and we'll investigate deeper.

  • THE Italian Profile Picture
    on at

    add bindings also to finsql.exe.config file

  • THE Italian Profile Picture
    on at

    This blog has been updated to reflect new findings. Your issue is related to missing correct bindings with finsql.exe.config file

  • Maksym Profile Picture
    10 on at

    Duilio Tacconi, thank you for you assistance.

    First problem is gone (all modified objects are compiled without any issues).

    Second problem still exists:

    Microsoft Dynamics NAV

    ---------------------------

    The connection setup cannot be validated. Verify the settings and try again.

    Detailed error description: Unable to cast object of type 'Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.InteractiveWebUI' to type 'Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.IWebUI'..

    ---------------------------

    OK

    ---------------------------

    According to error description we have inconsistent assignment : InteractiveWebUI to IWebUI object type of

    Microsoft.IdentityModel.Clients.ActiveDirectory library.

    Event viewer

    ExceptionStackTrace:

      at Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext.RunAsyncTask[T](Task`1 task)

      at Microsoft.Xrm.Tooling.Connector.CrmWebSvc.ObtainAccessToken(AuthenticationContext authenticationContext, String resource, String clientId, Uri redirectUri, PromptBehavior promptBehavior, UserIdentifier user)

      at Microsoft.Xrm.Tooling.Connector.CrmWebSvc.RefreshWebProxyClientToken()

      at Microsoft.Xrm.Tooling.Connector.CrmWebSvc.get_CrmWebClient()

      at Microsoft.Xrm.Tooling.Connector.CrmServiceClient.get_OrganizationWebProxyClient()

      at Microsoft.Dynamics.Nav.Runtime.CrmTableConnection.GetClientCredentials(CrmServiceClient connection)

      at Microsoft.Dynamics.Nav.Runtime.CrmTableConnection.ValidateCrmOnlineConnection(CrmConnectionStringBuilder crmConnectionStringBuilder, CrmServiceClient connection)

      at Microsoft.Dynamics.Nav.Runtime.CrmTableConnection.GetCrmServiceClientInstance(CrmConnectionStringBuilder crmConnectionStringBuilder)

      at Microsoft.Dynamics.Nav.Runtime.CrmTableConnection.GetOrganizationService()

      at Microsoft.Dynamics.Nav.Runtime.CrmDataProvider.<>c__DisplayClass69_0`1.<ExecuteServiceCall>b__0()

      at Microsoft.Dynamics.Nav.Types.NavThread.RunExternalAction[T](Func`1 action)

      at Microsoft.Dynamics.Nav.Runtime.CrmDataProvider.ExecuteServiceCall[T](Func`2 function, Func`2 handleException, IRecordBuffer recordBuffer)

    Could be problem in different file versions?

    NAV2017 Microsoft.IdentityModel.Clients.ActiveDirectory.dll v. 2.28.30916.1754

    NAV2018 Microsoft.IdentityModel.Clients.ActiveDirectory.dll v. 3.19.50615.2240

    Could you please assist ?

    Thank you in advance.

  • THE Italian Profile Picture
    on at

    I do not think so. Open a request to support, I think you have mixed files and versions at this stage.

  • THE Italian Profile Picture
    on at

    For the audience.

    This error arise because of trying to enable OAuth authentication after deploying the trick but within a NAV version that does not support this authentication type.

    When applying what's written in the blog post you have to leave the O365 legacy integration. This is just the short term mitigation due to RDS deprecation.

  • Samcham Profile Picture
    10 on at

    Hi, after applying the temporary fix with the dlls, we are getting this error :


    ---------------------------

    The connection setup cannot be validated. Verify the settings and try again.
    Detailed error description: Attempt by security transparent method 'Microsoft.Xrm.Tooling.Connector.CrmConnection..ctor(System.String, System.String, System.String, System.String, System.String, System.String, System.String, System.String, System.String, System.String, System.String, System.String, System.String, System.String)' to access security critical method 'Microsoft.IdentityModel.Clients.ActiveDirectory.UserIdentifier..ctor(System.String, Microsoft.IdentityModel.Clients.ActiveDirectory.UserIdentifierType)' failed.

    Assembly 'Microsoft.Xrm.Tooling.Connector, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' is partially trusted, which causes the CLR to make it entirely security transparent regardless of any transparency annotations in the assembly itself. In order to access security critical code, this assembly must be fully trusted..
    ---------------------------
    OK
    ---------------------------

    Edit: Nevermind, forgot to unclock the dll files.

  • ShanAbeywicrema Profile Picture
    948 on at

    This worked perfectly but again I am facing same problem today. Do we need to download higher CRM SDK?

  • THE Italian Profile Picture
    on at

    This is working perfectly in all environments. As of now, none had any issue. Most probably you have requested an extension to RDS to D365 team up until deadline (30th June) and now that RDS has been decommissioned your environment stop working and there is not other way than deploy shorter or longer term solution.

    If you cannot make it to deploy it alone, please open a support request to Microsoft.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,143

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,694 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,067 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans