简体   繁体   中英

Dynamics 365 CRM integration

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM