简体   繁体   中英

Can't connect to Dynamics 365 with Xrm.Tooling.Connector after 365 update

Our organization uses Dynamics Online and this weekend received a major update from CRM 2016 (8.1) to 365 (8.2), and since then my apps can't connect using the Xrm.Tooling.Connector:

CrmServiceClient client1 = new CrmServiceClient(ConfigurationManager.ConnectionStrings["XrmPowerString"].ConnectionString);

On app.config I have the connection string

<add name="MyConnectionString" connectionString="Url=https://myorgname.crm.dynamics.com; Username=me@mydomain.com; Password=mypassword; AuthType=Office365" />

I get error:

Microsoft.Xrm.Tooling.Connector.CrmServiceClient Error: 2 : Unable to Login to Dynamics CRM

And also

Microsoft.Xrm.Tooling.Connector.CrmServiceClient Error: 2 : Source : mscorlib Method : HandleReturnMessage Date : 14/08/2017 Time : 01:46:02 Error : An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail.

After researhing for a similar problem in dynamics 365 crm 9.0, we found that was caused by Security Protocol Type version.

Before instatiate your connection with CRM, ensure that your protocol version is TLS 1.2, adding the following code: ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

https://community.dynamics.com/crm/f/117/t/235290

Make sure you have the latest DLLs (8.2).

If you are working with the sample projects within the SDK (my case), you MUST delete the content of the BIN folder and update all packages because even on the latest SDK, the samples are referring the old dll version 8.0.

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