"Could not load System.Data.SqlClient, Version=4.6.1.1" error in XConnect Upgrade Tool


Description

When running the SitecoreXdbCollectionUpdateTool.exe from the XConnect Upgrade Tool via Windows command prompt, the following error might appear in the log file:

System.IO.FileLoadException: Could not load file or assembly 'System.Data.SqlClient, Version=4.6.1.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.

The issue affects Xconnect Upgrade Tool for Sitecore 10.4.0 rev. 010422, and does not affect Sitecore XConnect Upgrade Tool version 10.4.1 rev. 012093 and later.

Solution

To resolve the issue, add a configuration file with the correct binding redirects to the XConnect Upgrade Tool directory:

  1. Download the 10.4.0 upgrade tool from the official Sitecore site under Configuration files for upgrade.
  2. Extract Sitecore 10.4.0 rev. 010422 (upgrade files).zip into a new folder.
  3. Inside the extracted folder, locate and extract the XConnect Upgrade Tool.zip archive.
  4. Download the SitecoreXdbCollectionUpdateTool.exe.config
  5. Add the configuration file into the extracted  XConnect Upgrade Tool folder.
  6. Run the upgrade command as outlined in the official upgrade guide here.