Tuesday, April 16, 2019

Plugin Registration Tool - Object reference not set to an instance of an object


Exception Details
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Xrm.Tooling.CrmConnectControl.CrmConnectionManager.SetConfigKeyInformation(Dictionary`2 configKeys)
   at Microsoft.Xrm.Tooling.CrmConnectControl.CrmServerLoginControl.StartConnectCheck()
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.Controls.Primitives.ButtonBase.OnClick()
   at System.Windows.Controls.Button.OnClick()
   at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)


Steps by Step Approach to get Plugin Registration working.

Step 1) Download the latest SKD (https://xrm.tools/SDK), before you try other method to get things correct for you.

Step 2) Try Clean the content of the folder - C:\Users\Username\AppData\Roaming\Microsoft\PluginRegistration


The Folder contains Previous connections made.

Step 3) Clean any content from the folder - C:\Users\Vipin\LiveDeviceID



After cleaning the content of the folder, I was not getting any exception but then Plugin Registration Tool repeatedly asking me to choose the organization and I was got stuck in a loop.

So, I decided to have the latest SDK from - https://xrm.tools/SDK and then everything started working well. Its weird though, Tool should have complain about the version problem at the very first stage.


Here are some other links for Troubleshooting and learning:

·       Plugin in Dynamic 365 CRM

·       Connect to Dynamic 365 CRM from Console App using Azure Authentication

·       Could not load file or assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies

·       Unable to Login to Dynamics CRMOrganizationWebProxyClient is null

·       Assembly 'Microsoft.Crm.Sdk.Proxy' with identity 'Microsoft.Crm.Sdk.Proxy, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' uses 'Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'Microsoft.Xrm.Sdk' with identity 'Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

·       Could not load file or assembly 'Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.

·       Could not load file or assembly 'Microsoft.Xrm.Sdk, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies

No comments: