2
votes

I am working on an integration code to connect the On-Premise CRM to online. We updated the CRM from Dynamics 2015 to 365 and we need to update the on-premise CRM as well. The integration program needs to update the dlls referenced in order to integrate with Dynamics 365. When I try to connect using the credentials, an error is thrown as follows

"Exception thrown: 'System.NotSupportedException' in Microsoft.Xrm.Sdk.dll"

I cannot downgrade the dll version on this as it is of no use. This is the code I used to connect.

    using Microsoft.Crm.Sdk.Messages;
    using Microsoft.Xrm.Client;
    using Microsoft.Xrm;
    using System;
    using System.Collections.Generic;
    using System.Configuration;
    using System.Linq;
    using System.Net;
    using System.Net.Security;
    using System.Text;
    using System.Threading.Tasks;
    using Microsoft.Xrm.Tooling.Connector;

    namespace Integrations
    {
        class Program
        {
            static void Main(string[] args)
            {                 
                Console.WriteLine("Starting connection...");
                ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;
                string connectionString = ConfigurationManager.ConnectionStrings["CrmConnection"].ConnectionString;
                Console.WriteLine(connectionString);
                CrmServiceClient conn = new Microsoft.Xrm.Tooling.Connector.CrmServiceClient(connectionString);
                if (conn.IsReady)
                {
                    Console.WriteLine("Starting integrations...");
                       IntegrationMethod();
                    Console.WriteLine("Completed integrations... Closing.");
                }
                Environment.Exit(0);
            }
        }
    }

Any suggestions would be helpful.

1
What version of the SDK .dlls are you using and are they inline with the version of Dynamics? Could you also try removing the unnecessary .dlls (Client, Messages.. )?Dave Clark
@DaveClark thanks for the suggestion. I have connected it and the connection works perfect. At the moment I am facing a conflict due to one *.dll file. The SDK version I am using now is 8.0.0 as dynamics supports version 8 and above. The dll Microsoft.Xrm.Client is on version 6.0.0. After getting connected the integration stops throwing an exception on Microsoft.Xrm.Client. But the main integration code has its dependencies on this dll.Vijay Adhithyan Mohan

1 Answers

0
votes

It's probable that the Microsoft.Xrm.Sdk version it's superior to the SDK version in your Dynamics 365, example if you have v8.2 you cant use Microsoft.Xrm.Sdk version v9.0 (or superior) to connect, Sdk version from 7.x to 8.2 are forward-compatible only not backwardcompatible (MSFT link)

Have in mind that SDK version 9 deprecates support for previous version

Hope it helps Regards