Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Microsoft.Xrm.Tooling.Connector login Newtonsoft.Json assembly mismatch #460

Closed
julians1966 opened this issue Dec 6, 2023 · 4 comments
Closed

Comments

@julians1966
Copy link

Tool and Version
EarlyBoundGenerator V1 1.023.12.1

Describe the bug
A clear and concise description of what the bug is.

To Reproduce

  1. Launch Early Bound Generator V1
  2. Click Create Entities.
  3. In Microsoft Login control, select Office 365 and check Display list of available organizations and check Show Advanced
  4. Enter email address and password
    See error "An error occurred processing the login request"

Expected behavior
Connect to environment and retrieve metadata to generate early bound classes

Log
Source : Microsoft.Xrm.Tooling.Connector
Method : MoveNext
Date : 12/6/2023
Time : 6:25:49 AM
Error : Could not load file or assembly 'Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
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)

@julians1966
Copy link
Author

@daryllabar
Copy link
Owner

I'm unable to duplicate this on my end. Can you try updating the XTB's Plugin\EarlyBoundGenerator\CrmSvcUtil.Exe.config file in Newtonsoft redirect from

    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>

to

    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>

to see if that resolves the issue?

If so I'll push a new update out.

@julians1966
Copy link
Author

The change to the config file resolves the issue

@daryllabar
Copy link
Owner

Fix is in DLaB.Xrm.EarlyBoundGenerator.1.2023.12.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants