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

前端之家收集整理的这篇文章主要介绍了对于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,它们都有这个:

@H_301_13@<?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?

猜你在找的设计模式相关文章