F# PowerPack 目标运行时 [英] F# PowerPack Target Runtime

查看:15
本文介绍了F# PowerPack 目标运行时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

F# PowerPack 的预构建二进制文件是针对 .NET 2.0 运行时编译的.如果我有一个 .NET 4.0 项目,为 .NET 4 运行时编译 PowerPack 源有什么好处吗?

解决方案

我在 F# snippets 网站中使用了 .NET 2.0 版本的 F# PowerPack,这是一个 .NET 4.0 ASP.NET 项目.不使用 4.0 版本的唯一缺点是我在寻找 2.0 版本(由 2.0 版本的 PowerPack 引用)时必须添加配置以加载 4.0 版本的 FSharp.Core.dll.

我不得不添加类似以下内容,然后它工作得很好:

<预><代码><配置><!-- ... --><运行时><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><从属程序集><assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a"/><bindingRedirect oldVersion="2.0.0.0" newVersion="4.0.0.0"/></dependentAssembly></assemblyBinding></运行时></配置>

The pre-built binaries for the F# PowerPack are compiled against the .NET 2.0 runtime. If I have a .NET 4.0 project, is there any advantage to compiling the PowerPack source for the .NET 4 runtime?

解决方案

I used .NET 2.0 version of F# PowerPack in F# snippets web site, which is a .NET 4.0 ASP.NET project. The only disadvantage of not using 4.0 version was that I had to add configuration to load 4.0 version of FSharp.Core.dll when looking for 2.0 version (which is referenced by the 2.0 version of PowerPack).

I had to add something like the following and then it worked just fine:

<configuration>
  <!-- ... -->
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
      <assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" />
      <bindingRedirect oldVersion="2.0.0.0" newVersion="4.0.0.0" />
    </dependentAssembly>
  </assemblyBinding>
  </runtime>
</configuration>

这篇关于F# PowerPack 目标运行时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆