简体   繁体   English

FSLab模板项目运行时报错

[英]FSLab template project gives an error when running

FSLab template gives an error "The type provider 'RProvider.RProvider' reported an error: The type provider constructor has thrown an exception: Failed to start the R.NET server within 20 seconds" FSLab 模板给出错误“类型提供程序‘RProvider.RProvider’报告错误:类型提供程序构造函数抛出异常:无法在 20 秒内启动 R.NET 服务器”

I am using VS2015 and latest template from fslab.org我正在使用 VS2015 和来自 fslab.org 的最新模板

Anyone know how to work around this error?任何人都知道如何解决此错误? I get the same error when using VS2013 so I don't think it is related to VS.我在使用 VS2013 时遇到同样的错误,所以我认为它与 VS 无关。

RProvider.Server.exe is expecting FSharp.Core v4.3.0.0 but is bundled with 4.4, if you run RProvider.Server.exe you should see the exception. RProvider.Server.exe 期待 FSharp.Core v4.3.0.0 但与 4.4 捆绑在一起,如果您运行 RProvider.Server.exe,您应该会看到异常。 A work around is to add a RProvider.Server.exe.config file to the same directory with a binding redirect.解决方法是将 RProvider.Server.exe.config 文件添加到具有绑定重定向的同一目录中。

This is a pain.这是一种痛苦。 I am assuming you added FsLab from NuGet and tried building the project.我假设您从 NuGet 添加了 FsLab 并尝试构建该项目。 As @kev says, the current stable version of FsLab (0.3.18) bundles the wrong version of FSharp.Core.dll .正如@kev 所说,当前稳定版本的 FsLab (0.3.18) 捆绑了错误版本的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.要了解@kev 的含义,请转到$YOUR_PROJECT_DIR/packages/RProvider.1.1.17/lib/net40目录,在该目录中打开命令窗口,然后运行RProvider.Server.exe以查看自己的异常情况。

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).解决方法是创建一个绑定重定向,它会告诉运行时查找实际捆绑的程序集版本 (4.4.0.0),而不是它期望的程序集版本 (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...为此,请在上述目录中创建一个名为RProvider.Server.exe.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>

...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.要进行检查,请从命令行运行RProvider.Server.exe (它应该提供与之前不同的输出)或重建您的项目以检查错误消息是否停止出现。

Obviously, this will hopefully just go away when the FsLab NuGet package gets sorted out.显然,当 FsLab NuGet 包得到整理后,这有望消失。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM