web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

XrmToolkit v5.1.4 error logging onto the organization

(0) ShareShare
ReportReport
Posted on by

Hi,


I am having an "error logging onto the organization" with Xrmtoolkit v5.1.4 from visual studio, to an onPremise CRM 2016.

Here is the error from VS:

[XrmToolkit v5.1.4.0] -- <Critical> -- 28.02.2019 13:23:18 -- There was an error logging onto the organization and loading the xrm file
[XrmToolkit v5.1.4.0] -- <Critical> -- 28.02.2019 13:23:18 -- An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail.
At least one security token in the message could not be validated.

Server stack trace:
at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.ProcessReply(Message reply, SecurityProtocolCorrelationState correlationState, TimeSpan timeout)
at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Microsoft.Xrm.Sdk.Discovery.IDiscoveryService.Execute(DiscoveryRequest request)
at Microsoft.Xrm.Sdk.Client.DiscoveryServiceProxy.Execute(DiscoveryRequest request)
at SS.Crm.Common.Helpers.CrmServiceHelper.GetOrganizations(IDiscoveryService service)
at SS.Crm.Common.Helpers.ObjectHelper.GetOrganizationVersion(IDiscoveryService Service, Guid OrganizationId)
at SS.Crm.Common.Helpers.ObjectHelper.<>c__DisplayClass107_0.<GetOrganizationVersionAsync>b__0()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SS.Crm.Common.Helpers.ObjectHelper.<GetOrganizationVersionAsync>d__107.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SS.XrmToolkit.Common.Controllers.CacheController.<GetOrganizationVersionAsync>d__64.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SS.XrmToolkit.Common.Controllers.CacheController.<LoadCachedDataForOrganizationAsync>d__41.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at SS.XrmToolkit.Controllers.VisualStudioEventController.<OnLoggedOnToOrganization>d__35.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SS.XrmToolkit.Common.UI.Forms.frmConnectToOrganization.<frmConnectToOrganization_FormClosed>d__24.MoveNext()
[XrmToolkit v5.1.4.0] -- <Info> -- 28.02.2019 13:23:53 -- Creating a new IOrganization service...
[XrmToolkit v5.1.4.0] -- <Info> -- 28.02.2019 13:23:54 -- Getting the metadata changes from CRM...
[XrmToolkit v5.1.4.0] -- <Error> -- 28.02.2019 13:23:54 -- Object reference not set to an instance of an object.
at SS.XrmToolkit.Common.Controllers.CacheController.<LoadMetadataUpdatesAsync>d__58.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SS.XrmToolkit.Controllers.CacheController.<LoadMetadataUpdatesAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SS.XrmToolkit.UI.Menus.SolutionMenuCommandLogic.<RefreshMetadataAsync_Clicked>d__20.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SS.XrmToolkit.UI.Menus.MenuCommandLogic.<ButtonClicked_LicenseRequired>d__26.MoveNext()
[XrmToolkit v5.1.4.0] -- <Critical> -- 28.02.2019 13:23:54 -- Error
[XrmToolkit v5.1.4.0] -- <Critical> -- 28.02.2019 13:23:54 -- Object reference not set to an instance of an object.
at SS.XrmToolkit.Common.Controllers.CacheController.<LoadMetadataUpdatesAsync>d__58.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SS.XrmToolkit.Controllers.CacheController.<LoadMetadataUpdatesAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SS.XrmToolkit.UI.Menus.SolutionMenuCommandLogic.<RefreshMetadataAsync_Clicked>d__20.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SS.XrmToolkit.UI.Menus.MenuCommandLogic.<ButtonClicked_LicenseRequired>d__26.MoveNext()

Same error with VS2017 and VS2015. 
Any tips on how to resolve this error?

Thank you

*This post is locked for comments

I have the same question (0)
  • David Jennaway Profile Picture
    14,065 on at

    First, check that the connection and credentials are correct. 

    Are you using AD authentication or Claims authentication ? If it's claims authentication, then there are scenarios where there are issues with the claims authentication setup that only appear when connecting programmatically (e.g with XrmToolkit), while the CRM UI works fine. If you are using claims authentication, enable CRM tracing, and also check the ADFS event log to see if there is more useful information

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans