在运行时,我收到以下错误:
无法加载文件或程序集' WebDriver.Support,Version = 3.7.0.0,Culture = neutral,PublicKeyToken = null'或其中一个依赖项。定位的程序集的清单定义与程序集引用不匹配。
我该如何解决?我尝试过使用bindingRedirects但是当引用没有使用公钥令牌签名时,我认为这不起作用(或者是必需的?)。
我使用这些软件包(在.NET框架4.6.1下运行):
<package id="Selenium.Support" version="3.7.0" targetFramework="net461" />
<package id="Selenium.WebDriver" version="3.7.0" targetFramework="net461" />
包含这些程序集:
WebDriver, Version=3.7.0.0, Culture=neutral, PublicKeyToken=null
WebDriver.Support, Version=3.7.0.0, Culture=neutral, PublicKeyToken=null
我的项目参考:
<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登录例外:
=== 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.