visual-studio-2012 - 系统丢失方法异常 : Method not found: 'Microsoft .FSharp.Core.FSharpFunc` 2

标签 visual-studio-2012 f# missingmethodexception canopy-web-testing

我在 Windows 环境中启动 Canopy 测试时遇到问题:

Unhandled Exception: System.MissingMethodException: Method not found: 'Microsoft
.FSharp.Core.FSharpFunc`2<System.String,System.String> canopy.core.get_xpath()'.
at <StartupCode$UITest>.$Program.main@()

我猜这是因为在编译它时,我的 Visual Studio 2012 恢复了 Nuget 包并将其吐到控制台输出中:

Consider app.config remapping of assembly "FSharp.Core, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" from Version "4.3.0.0" [C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\3.0\Runtime\v4.0\FSharp.Core.dll] to Version "4.4.0.0" [C:\Users\Andres\Documents\Code\endtoendtests\packages\FSharp.Core.4.0.0.1\lib\net40\FSharp.Core.dll] to solve conflict and get rid of warning.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3247: Found conflicts between different versions of the same dependent assembly.
C:\Program Files (x86)\Microsoft SDKs\F#\3.0\Framework\v4.0\fsc.exe -o:obj\x86\Debug\UITest.exe -g --noframework --define:DEBUG --optimize- --tailcalls- --platform:x86 -r:C:\Users\Andres\Documents\Code\endtoendtests\packages\canopy.0.9.52\lib\canopy.dll -r:C:\Users\Andres\Documents\Code\endtoendtests\packages\FSharp.Core.4.0.0.1\lib\net40\FSharp.Core.dll -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Core.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Drawing.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Numerics.dll" -r:C:\Users\Andres\Documents\Code\endtoendtests\packages\Selenium.WebDriver.2.53.0\lib\net40\WebDriver.dll --target:exe --warnaserror:76 --vserrors --validate-type-providers --LCID:1033 --utf8output --fullpaths --flaterrors --highentropyva- "C:\Users\Andres\AppData\Local\Temp\.NETFramework,Version=v4.0.AssemblyAttributes.fs" AssemblyInfo.fs Program.fs 
UITest -> C:\Users\Andres\Documents\Code\endtoendtests\UITest\bin\Debug\UITest.exe

如何准确添加此重新映射来解决此问题?

最佳答案

设法让它与此 App.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.3.0.0" newVersion="4.4.0.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

这一定是因为我从来没有安装过F#,所以我使用的是VS2012(v3.0)自带的版本。我知道我知道,我应该升级到 3.1,甚至 4.0。

关于visual-studio-2012 - 系统丢失方法异常 : Method not found: 'Microsoft .FSharp.Core.FSharpFunc` 2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36613953/

相关文章:

f# - 使用 Unquote 断言时的 MissingMethodException

grails - 部署Grails应用程序时Glassfish服务器问题

c++ - 在 windows 7 32 位上使用 openssl 1.0.2d 和 visual studio 2010 在 c++ 中实现 TLS1.2 连接

f# - 将 OCaml 转换为 F# : Converting OCaml quotation add and quotation expander to F#

F# 事件模式作为非静态成员

f# - op_addition 的静态成员约束

c# - 带有 Mono 的 MissingMethodException

c# - Unitests 和 VS2012 Update 2 CTP 4 的问题

testing - 无法从 VS 2012 中的测试资源管理器运行测试

compiler-errors - 带有C++/CLI的VS2012中的错误C2039错误