1
votes

I am using Plugin Registration Tool in CRM SDK 2013. When creating new connection to CRM 2013 Online, I get the error: "Unable to connect to the CRM Organization". The details is as below:

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
   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.Button.OnClick()
   at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Window.ShowHelper(Object booleanBox)
   at System.Windows.Window.ShowDialog()
   at Microsoft.Crm.Tools.PluginRegistration.MainViewModel.CreateConnections()

The error shows even when I click Login without username and password.

I tried deleting LiveDevice.xml and LiveDeviceID.xml in C:\Users\\LiveDeviceID folder, but it's no use.

Any idea or workaround is appreciated. Thanks in advance!

UPDATE: I tried registration tool in SDK 2011, somehow it can connect successfully. However, I can't debug my plugins because of datacontract parsing, I can only register/unregister plugins.

3

3 Answers

3
votes

Ok i got this working by deleting the following AppData folder as I getting an access denied error in the pluginregistration tool log file. C:\Users{username}\AppData\Roaming\Microsoft\PluginRegistration.

1
votes

The error message is specific to the failure to find the organization that you are connecting to. Please double check with the discovery URL for your CRM online instance under Settings > Customizations > Developer Resources

For CRM Online 2013, it would be 'https://disco.crm.dynamics.com' and not 'https://orgname.crm.dynamics.com'

0
votes

I've had a similar problem with my plugin registration tool... Upgrading to the newest version worked for me.

http://www.microsoft.com/en-us/download/details.aspx?id=40321