1

At run-time I get the following error:

Could not load file or assembly 'WebDriver.Support, Version=3.7.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.

How can I fix it? I've tried using bindingRedirects but I don't think that works (or is required?) when the references aren't signed with a public key token.

Extra info

I'm using these packages (running under.net framework 4.6.1):

  <package id="Selenium.Support" version="3.7.0" targetFramework="net461" />
  <package id="Selenium.WebDriver" version="3.7.0" targetFramework="net461" />

Containing these assemblies:

WebDriver, Version=3.7.0.0, Culture=neutral, PublicKeyToken=null
WebDriver.Support, Version=3.7.0.0, Culture=neutral, PublicKeyToken=null

My project's references:

<Reference Include="WebDriver, Version=3.7.0.0, Culture=neutral, processorArchitecture=MSIL">
  <HintPath>..\packages\Selenium.WebDriver.3.7.0\lib\net45\WebDriver.dll</HintPath>
  <Private>True</Private>
</Reference>
<Reference Include="WebDriver.Support, Version=3.7.0.0, Culture=neutral, processorArchitecture=MSIL">
  <HintPath>..\packages\Selenium.Support.3.7.0\lib\net45\WebDriver.Support.dll</HintPath>
  <Private>True</Private>
</Reference>

Fusion Log in the Exception:

=== Pre-bind state information ===
LOG: DisplayName = WebDriver.Support, Version=3.7.0.0, Culture=neutral, PublicKeyToken=null
 (Fully-specified)
LOG: Appbase = file:///REMOVED FOR STACKOVERFLOW/bin/Debug
LOG: Initial PrivatePath = NULL
Calling assembly : MyProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\REMOVED FOR STACKOVERFLOW\bin\Debug\MyProject.Tests.Integration.dll.config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///REMOVED FOR STACKOVERFLOW/MyProject.Tests.Integration/bin/Debug/WebDriver.Support.DLL.
WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY TOKEN
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
Lee
  • 1,591
  • 1
  • 14
  • 28
  • Are you using NuGet to get these files? If not, I would recommend using it. If you did, I would uninstall it and then reinstall it and see if that fixes the issue. If it still doesn't, uninstall it and then look in your references file for references to it. You may have to manually delete them and then reinstall. – JeffC Nov 04 '17 at 05:27
  • It's working now, I previously used DLLs directly but then switched to packages, in doing so I made sure the package wasn't installed anywhere needlessly. However I've now found there was a reference in a project where it wasn't needed (thus no DLL present), deleting the reference fixed the issue. I bet had I looked at warnings I would have spotted it! Thanks for your help @JeffC – Lee Nov 15 '17 at 22:59

0 Answers0