对于F#类型提供程序,如何为依赖程序集执行绑定重定向?

我正在研究一个依赖于FParsec 0.9.2.0的F#Type Provider.它取决于FSharp.Core 4.0.0.0.当我尝试使用F#Type Provider时,出现此错误:

{“Could not load file or assembly ‘FSharp.Core,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. The system cannot find the file specified.”:”FSharp.Core,PublicKeyToken=b03f5f7f11d50a3a”}

=== Pre-bind state information ===
LOG: DisplayName = FSharp.Core,PublicKeyToken=b03f5f7f11d50a3a (Fully-specified)
LOG: Appbase = file:///C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/
LOG: Initial PrivatePath = NULL
Calling assembly : FParsec,Version=0.9.2.0,PublicKeyToken=e5c8267bb3bd1265.

我尝试添加了一个Froto.Gen.dll.config和一个FParsec.dll.config,它们都有这个:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="4.0.0.0" newVersion="4.3.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

没运气.有任何想法吗?我的下一个行动计划是构建一个新的FParsec.dll,但这并不总是有效.

您是否尝试重写AppDomain.CurrentDomain.AssemblyResolve,并在args.Name需要4.0.0.0时对FSharp.Core 4.3.0.0的位置执行显式Assembly.LoadFrom?

相关文章

什么是设计模式一套被反复使用、多数人知晓的、经过分类编目...
单一职责原则定义(Single Responsibility Principle,SRP)...
动态代理和CGLib代理分不清吗,看看这篇文章,写的非常好,强...
适配器模式将一个类的接口转换成客户期望的另一个接口,使得...
策略模式定义了一系列算法族,并封装在类中,它们之间可以互...
设计模式讲的是如何编写可扩展、可维护、可读的高质量代码,...