Sunday 7 January 2018

Dynamics 365 Latest Version V9 - Unable To Connect Plugin Registration Tool and External Application

Hello Everyone,

If you have recently made Dynamic CRM Trial and started facing issues while connecting it through Plugin Registration Tool, Configuration Migration Tool, External Application like console, web app, window form app etc then this article is for you.

Latest Update on Dynamics CRM V9:


Latest update in the Microsoft TSL(Transport Security Layer) Protocol in SDK assemblies.

Microsoft allowed the TSL connection 1.0  and 1.1 for the browsers or client to connect the CRM org. Now Microsoft will support only TSL 1.2 or above. Can get more information here

If you are connecting your latest dynamic CRM trial org with the old version of plugin registration tool or connecting any external application, then you may face an issue.

How would I get to know about Protocol Version of my system?


Install Fiddler:


Install fiddler from here.

Once Fiddler gets installed, Go to Tools > Options in order to check Protocol version:


















Issue Observed:


Issue 1

Microsoft.Xrm.Tooling.Connector.CrmServiceClient Error 2 07-Jan-18 1:06:56 PM  Source : mscorlib
Method : GetResultCore
Date : 07-Jan-18
Time : 1:06:56 PM
Error : One or more errors occurred.
Stack Trace : at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at Microsoft.Xrm.Tooling.Connector.CrmWebSvc.ExecuteAuthenticateServiceProcess(Uri serviceUrl, ClientCredentials clientCredentials, UserIdentifier user, String clientId, Uri redirectUri, PromptBehavior promptBehavior, String tokenCachePath, Boolean isOnPrem, String authority, Uri& targetServiceUrl, AuthenticationContext& authContext, String& resource)
   at Microsoft.Xrm.Tooling.Connector.CrmWebSvc.ConnectAndInitCrmOrgService(OrganizationDetail orgdata, Boolean IsOnPrem, Uri homeRealmUri)
   at Microsoft.Xrm.Tooling.Connector.CrmWebSvc.InitCRM2011Service()
======================================================================================================================
Inner Exception Level 1
Source : Microsoft.IdentityModel.Clients.ActiveDirectory
Method : Close
Date : 07-Jan-18
Time : 1:06:56 PM
Error : Object reference not set to an instance of an object.
Stack Trace : at Microsoft.IdentityModel.Clients.ActiveDirectory.HttpWebResponseWrapper.Close()
   at Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationParameters.<CreateFromResourceUrlCommonAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationParameters.<CreateFromResourceUrlAsync>d__8.MoveNext()
======================================================================================================================

Microsoft.Xrm.Tooling.Connector.CrmServiceClient Error 2 07-Jan-18 1:06:56 PM  Unable to Login to Dynamics CRM
Microsoft.Xrm.Tooling.CrmConnectControl Information 8 07-Jan-18 1:06:56 PM  Login Status in Connect is =  Can't connect to Microsoft Dynamics CRM - orged437722.


Issue 2:

Source : Microsoft.Xrm.Tooling.Connector
Method : RegisterDevice
Date : 30-Dec-17
Time : 12:58:25 PM
Error : DeviceAlreadyExists: 0x80041132
Stack Trace : at Microsoft.Xrm.Tooling.Connector.DeviceIdManager.RegisterDevice(Guid applicationId, Uri issuerUri, LiveDevice device)
   at Microsoft.Xrm.Tooling.Connector.DeviceIdManager.RegisterDevice(Guid applicationId, Uri issuerUri, String deviceName, String devicePassword)
   at Microsoft.Xrm.Tooling.Connector.DeviceIdManager.LoadOrRegisterDevice()
   at Microsoft.Xrm.Tooling.CrmConnectControl.CrmConnectionManager.GenerateDeviceCreds()
   at Microsoft.Xrm.Tooling.CrmConnectControl.CrmConnectionManager.ValidateServerConnection(CrmOrgByServer selectedOrg)

Resolution:


To resolve Plugin Registration Tool Issue, you need to install Latest Plugin Registration Tool from NuGet website instead of 365 SDK.


To download the Plugin Registration Tool from NuGet Package Tool site, you have two options.

Option 1:

Navigate to Tools >  NuGet Package Manager > Package Manager Console



Run Command :

Install-Package Microsoft.CrmSdk.XrmTooling.PluginRegistrationTool -Version 9.0.0.7

See this link for more info.
















Option 2:

Open Visual Studio and Create any Sample Project for example: Create a Class Library Project.

















Right Click on Project and click Manage NuGet Packages...
































Click on Online from the Left panel and Search 'Microsoft.CrmSdk.XrmTooling.PluginRegistrationTool' and click on Install.





















Once installed Right click on Project to view the installed package








































Open package and Navigate to below path:

\packages\Microsoft.CrmSdk.XrmTooling.PluginRegistrationTool.9.0.0.7\tools














Open Plugin Registration Tool

























Make sure the version of Microsoft.Xrm.Sdk version is 9.0























Enter your organisation details and Connect Plugin Registration Tool.














To resolve External Application connection issue.


.For Custom Application like Console/WebApp/WindowApp:App :

Include the below reference to your project (to global config file the line before where your client credentials is configured) and change .Net framework to 4.6.1 and rebuild

"ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12"














Source http://mscrm365.blogspot.in/2018/01/dynamics-crm-v9-connection-error-in.html


To resolve Report Issue:


Uninstall Report Authoring Extension and install the latest.(Make sure Installed dll is the latest SDK 9.0).

If you do not want to perform all the above steps and want to continue with Old SDK, Change your system protocol setting as per below instructions using Fiddler.





Click <client;ssl3;tls1.0> (highlighted above) and change Protocol to tls1.2 and click OK



Warning: You may start getting the Internet Connection Issue after doing this setting. So recommend to download the latest tool from NuGet Package instead of this setting.




















1 comment:

Blogger Widgets