我正在研究一个依赖于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?
原文链接:https://www.f2er.com/javaschema/281646.html