2

FSLab 模板报错“类型提供者‘RProvider.RProvider’报错:类型提供者构造函数抛出异常:无法在 20 秒内启动 R.NET 服务器”

我正在使用来自 fslab.org 的 VS2015 和最新模板

任何人都知道如何解决这个错误?我在使用 VS2013 时遇到了同样的错误,所以我认为它与 VS 无关。

4

2 回答 2

1

RProvider.Server.exe 期待 FSharp.Core v4.3.0.0 但与 4.4 捆绑在一起,如果您运行 RProvider.Server.exe,您应该会看到异常。一种解决方法是将 RProvider.Server.exe.config 文件添加到具有绑定重定向的同一目录中。

于 2016-04-16T02:16:29.053 回答
1

This is a pain. I am assuming you added FsLab from NuGet and tried building the project. As @kev says, the current stable version of FsLab (0.3.18) bundles the wrong version of FSharp.Core.dll. To see what @kev meant, go to the $YOUR_PROJECT_DIR/packages/RProvider.1.1.17/lib/net40 directory, open a command window there, and run RProvider.Server.exe to see the exception for yourself.

The cure is to create a binding redirect that would tell the runtime to look for the assembly version that is actually bundled (4.4.0.0) instead of the one it expects (4.3.0.0). To do this, create a file in the above mentioned directory, called RProvider.Server.exe.config, and paste the following into it...

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

...and you should be good to go. To check, either run RProvider.Server.exe from the command line (it should give a different output to before) or rebuild your project to check that the error message stops appearing.

Obviously, this will hopefully just go away when the FsLab NuGet package gets sorted out.

于 2016-04-17T22:49:57.310 回答