MscrmTools / XrmToolBox

An application that gather multiple tools to ease the customization and configuration of Microsoft Dynamics CRM/365/Dataverse/PowerApps
https://www.xrmtoolbox.com
GNU General Public License v3.0
567 stars 212 forks source link

Unable to connect: Method not found [BUG] #1320

Open SescoEnvDev opened 7 months ago

SescoEnvDev commented 7 months ago

Describe the bug When attempting to use my existing connections after applying an update to XrmToolBox, I receive an error message. My credentials have not changed. The problem persists after deleting a connection and attempting to re-add it. I've tried using the connection wizard, Oauth/MFA, Microsoft Login Control, and Client ID/Secret

To Reproduce -Select existing connection -Attempt to connect -Failure

-Create New Connection -Choose Connection Wizard -enter CRM URL, username, and password -Failure

-Create new connection -Choose Microsoft Login Control -Select Office 365 -enter Username and Password -Approve Sign-in request -failure

Expected behavior I expect my existing connections to work, as they always have. I expect providing my CRM URL and credentials in the connection manager to successfully connect. When I'm prompted for sign-in approval, I expect the approved and authenticated login to work,

Screenshots -When using existing connection: image

-When using Connection Wizard: image

-When using Microsoft Login Control, I receive this error:

Source : Microsoft.Xrm.Tooling.Connector Method : MoveNext Date : 2/12/2024 Time : 11:19:51 AM Error : Method not found: 'Void Microsoft.Xrm.Sdk.Discovery.OrganizationDetail.set_SchemaType(System.String)'. Stack Trace : at Microsoft.Xrm.Tooling.Connector.CrmWebSvc.d__204.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.Start[TStateMachine](TStateMachine& stateMachine) at Microsoft.Xrm.Tooling.Connector.CrmWebSvc.QueryGlobalDiscovery(String authToken, Uri discoveryServiceUri, CrmLogEntry logSink) at Microsoft.Xrm.Tooling.Connector.CrmWebSvc.DiscoverGlobalOrganizations(Uri discoveryServiceUri, ClientCredentials clientCredentials, X509Certificate2 loginCertificate, UserIdentifier user, String clientId, Uri redirectUri, PromptBehavior promptBehavior, String tokenCachePath, Boolean isOnPrem, String authority, CrmLogEntry logSink, Boolean useGlobalDisco, Boolean useDefaultCreds) at Microsoft.Xrm.Tooling.Connector.CrmWebSvc.DiscoverOrganizations(Uri discoveryServiceUri, ClientCredentials clientCredentials, UserIdentifier user, String clientId, Uri redirectUri, PromptBehavior promptBehavior, String tokenCachePath, Boolean isOnPrem, String authority, CrmLogEntry logSink, Boolean useGlobalDisco, Boolean useDefaultCreds) at Microsoft.Xrm.Tooling.CrmConnectControl.CrmConnectionManager.QueryOAuthDiscoveryServer(Uri discoServer, ClientCredentials liveCreds, UserIdentifier user, String clientId, Uri redirectUri, PromptBehavior promptBehavior, String tokenCachePath, Boolean useGlobalDisco) at Microsoft.Xrm.Tooling.CrmConnectControl.CrmConnectionManager.QueryOnlineServerList(ObservableCollection1 svrs, OrganizationDetailCollection col, ClientCredentials liveCreds, Uri trimToDiscoveryUri, Uri globalDiscoUriToUse) at Microsoft.Xrm.Tooling.CrmConnectControl.CrmConnectionManager.FindCrmOnlineDiscoveryServer(ClientCredentials liveCreds) at Microsoft.Xrm.Tooling.CrmConnectControl.CrmConnectionManager.ValidateServerConnection(CrmOrgByServer selectedOrg)

Desktop (please complete the following information):

bwmodular commented 6 months ago

Same issue here after updating the toolbox to 1.2023.12.68 this morning. Method not found: 'System.String Microsoft.Xrm.Sdk.OrganizationDetail.get_SchemaType()'

Still working with On Premises connections, but not with D365 connections using either Username/Password or Client Secret credentials

bwmodular commented 6 months ago

And just to confirm, reverting to 1.2023.10.67 fixes the problem with these connections. Happy to help troubleshoot if I can help in any way.

SescoEnvDev commented 6 months ago

I was able to create new functional connections after the following steps: 1) fully deleting all the previously installed libraries in the Roaming folder, as well as the installation folder. 2) re-downloading the latest stable version, unzipping and running/installing. I did have to manually delete the Deployment tool, but that’s a plugin-specific issue and not covered here.

I’m inclined to believe the underlying issue is a library/.dll issue, but I’m not necessarily knowledgeable to pin it down. For all practical purposes, this issue can probably be closed.

MscrmTools commented 6 months ago

Hi everyone, Sorry I was so silent but I have so much work these days, it's complicated for me to handle everything... Anyway, the problem seems related to change in a Microsoft assembly.

Question : Are you allowing use of beta version of connection controls?

bwmodular commented 6 months ago

Let me check whether updating the ToolBox, rather than just the connectionj control gives the same problem. I don't remember whether I just updated the Connection Control, or the entire toolbox, but I do not that reverting to the previous release of the toolbox fixed the problem. I'll experiment a bit more and get back to you....

bwmodular commented 6 months ago

I tried the following: Just update the connection controls to the latest beta This breaks existing connections to online instances.

I then updated the toolbox itself to 1.2023.12.68. - this fixes the problem because it must use an older version of the connection controls. It prompted me to update my connection controls to the latest beta and I said no and everything continues to work.

So it looks like it's the beta version of the connection controls, rather than an update to the Tookbox which is causing the issue

crmpatrick commented 6 months ago

I was able to create new functional connections after the following steps: 1) fully deleting all the previously installed libraries in the Roaming folder, as well as the installation folder. 2) re-downloading the latest stable version, unzipping and running/installing. I did have to manually delete the Deployment tool, but that’s a plugin-specific issue and not covered here. I’m inclined to believe the underlying issue is a library/.dll issue, but I’m not necessarily knowledgeable to pin it down. For all practical purposes, this issue can probably be closed.

I had to resort to the same process of removing everything and re-installing. With the default tools present, I could re-create a connection that had stopped working after months of working correctly. I suppose the next process is adding back tools one at a time.