绑定重定向

本文关键字:重定向 绑定 | 更新日期: 2023-09-27 18:34:05

需要引用一个库'configit。基地.dll'来自我的一个项目。不幸的是,我的项目已经使用了Ionic.Zip.dll版本1.9.3.0,它看起来像configit。Base.dll需要Ionic.Zp.dll的1.9.1.8版本,因此当我尝试运行程序时,出现加载错误。我尝试将以下内容添加到mu .config文件中:

  <dependentAssembly>
    <assemblyIdentity name="Ionic.Zip" publicKeyToken="edbe51ad942a3f5c" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-1.9.1.8" newVersion="1.9.3.0" />
  </dependentAssembly>

没有任何成功。如果我运行 fuselogwv,我会得到以下内容:

=== Pre-bind state information ===
LOG: DisplayName = Ionic.Zip, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c
(Fully-specified)
LOG: Appbase = file:///C:/Local/Projects/Playground/ConfigItLoad1/ConfigItLoad1/bin/Debug/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = ConfigItLoad1.exe
Calling assembly : Configit.Base, Version=2.0.0.111, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:'Local'Projects'Playground'ConfigItLoad1'ConfigItLoad1'bin'Debug'ConfigItLoad1.exe.Config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:'Windows'Microsoft.NET'Framework64'v4.0.30319'config'machine.config.
LOG: Post-policy reference: Ionic.Zip, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Local/Projects/Playground/ConfigItLoad1/ConfigItLoad1/bin/Debug/Ionic.Zip.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:'Local'Projects'Playground'ConfigItLoad1'ConfigItLoad1'bin'Debug'Ionic.Zip.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: Ionic.Zip, Version=1.9.3.0, Culture=neutral, PublicKeyToken=null
WRN: Comparing the assembly name resulted in the mismatch: Revision Number
ERR: The assembly reference did not match the assembly definition found.
ERR: Run-from-source setup phase failed with hr = 0x80131040.
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

这是否意味着 Ioniz.Zip 1.9.3.0 与 1.9.1.8 如此不同,以至于无法加载?

蒂亚

/索伦

绑定重定向

这并不意味着

Ioniz.Zip 1.9.3.0 与 1.9.1.8 如此不同,以至于无法加载。

以下行表明未发生绑定重定向:

LOG: Post-policy reference: Ionic.Zip, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c

确保您的配置条目格式正确 (MSDN) 并位于

C:'Local'Projects'Playground'ConfigItLoad1'ConfigItLoad1'bin'Debug'ConfigItLoad1.exe.Config

或您的机器配置。

签入 CSPROJ 文件。如果指定了任何版本,请将其删除。