Fsharp.Core 的正确版本 [英] Correct version of Fsharp.Core

查看:16
本文介绍了Fsharp.Core 的正确版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Visual Studio 2013 Ultimate 构建 F# 控制台应用程序.目标框架是.Net 4.5

我电脑上安装的FSharp.Core版本(大概是安装VS 2013)是4.3.1.0.

在 NuGet 上有两个版本的 FSharp.Core,2012 年 4 月 12 日发布的 4.0.0 和 2013 年 3 月 5 日发布的 ID 为 FSharp.Core.3 版本 0.0.2 的一个.

我正在寻找有关何时应该使用这些版本中的每一个的指导,版本编号让我感到困惑,我原本希望在 NuGet 上找到最新的生产版本.

我错过了什么吗?

解决方案

您不应该从 nuget 获取 FSharp.Core.Microsoft 今天没有向 nuget 发布任何官方 F# 位(尽管这在未来可能会发生变化).3rd 方包捆绑 FSharp.Core 很常见(因为大概这是用于测试/验证该 3rd 方组件的版本),但 nuget 目前不应用作获取FSharp.Core 更新或新版本.

遗憾的是,FSharp.Core 的版本故事相当复杂,绝对不像更高版本意味着更新"那么简单.需要意识到的一个关键是有两个轴 - 运行时支持哪个 F# 版本,以及它针对的是哪个 .NET 框架版本/配置文件.

以下是 VS 2013 附带的官方 FSharp.Core 版本(在 %ProgramFiles(x86)%Reference AssembliesMicrosoftFSharp 下找到这些版本).

  • 4.3.1.0 (F# 3.1/.NET 4) 这是最新的正式版本.除非您有面向 .NET 2 的要求,或者您正在使用一些不适用于 3.1 的旧版 F# 组件,否则您应该将这个版本用于任何新的桌面应用.
  • 4.3.0.0 (F# 3.0/.NET 4) 这些与 VS 2012 附带的位相同.包含它是为了让您可以继续在 VS 2013 中处理 F# 3.0 项目而无需重新定位他们到 3.1.如果您有一个尚未准备好迁移到 3.1 的旧版 F# 3.0 桌面项目,则应该使用它.
  • 2.3.0.0 (F# 3.0/.NET 2) 这些与 VS 2012 附带的位相同.使用它的唯一原因是如果您的目标是 .NET 2..NET事情的 2 方面没有进一步开发,顺便说一句 - 将为面向 .NET 4+ 的 FSharp.Core 完成新功能、版本等;.NET 2 FSharp.Core 仍受完全支持,但已被冻结.
  • 3.3.1.0(F# 3.1/便携式")此版本面向 .NET 便携式配置文件 7(.NET 4.5/Windows 应用商店).如果您正在为 Windows 商店应用程序创建组件并且您不关心 Silverlight,请使用此选项.VS 2013 新支持此配置文件.
  • 2.3.5.1(F# 3.1/Portable (Legacy)")此版本面向 .NET 可移植配置文件 47(.NET 4/Silverlight 5/Windows Store).如果您正在创建 Silverlight 组件,请使用此选项.VS 2012 也支持此配置文件,当时简称为便携式".
  • 2.3.5.0(F# 3.0/便携式(传统)")此版本面向 .NET 便携式配置文件 47(.NET 4/Silverlight 5/Windows 应用商店).这些与 VS 2012 中包含的部分相同.包含在 VS 2013 中的目的是使您能够继续处理 F# 3.0 便携式/silverlight 项目.

.NET 可移植配置文件是一个很大的 PITA,会导致大量的复杂性.这个网站有一个很好的总结来帮助理解:

I am building an F# console application with Visual Studio 2013 Ultimate. The target framework is .Net 4.5

The version of FSharp.Core installed on my computer (presumably by installing VS 2013) is 4.3.1.0.

On NuGet there are two versions of FSharp.Core, 4.0.0 published April 12, 2012 and one with an ID of Fsharp.Core.3 verison 0.0.2 published March 5, 2013.

I am looking for guidance as to when one should use each of these versions, the version numbering is confusing me and I would have expected to find the latest production release on NuGet.

Am I missing something?

解决方案

You should not be obtaining FSharp.Core from nuget. Microsoft does not publish any official F# bits to nuget today (though this could potentially change in the future). It's common for 3rd-party packages to bundle FSharp.Core (since presumably that's the version used for testing/validation of that 3rd-party component), but nuget should not currently be used as a mechanism for getting FSharp.Core updates or new versions.

The versioning story for FSharp.Core is sadly rather complex, and definitely not as simple as "higher version means newer." A key thing to realize is that there are 2 axes - what F# version does the runtime support, and what .NET framework version/profile does it target.

Below are the official FSharp.Core versions that ship with VS 2013 (find these dropped under %ProgramFiles(x86)%Reference AssembliesMicrosoftFSharp).

  • 4.3.1.0 (F# 3.1/.NET 4) This is the most recent official version. Unless you have a requirement to target .NET 2, or you are using some legacy F# component that won't work with 3.1, this is the version you should use for any new desktop app.
  • 4.3.0.0 (F# 3.0/.NET 4) These are the same bits that shipped with VS 2012. It is included so that you can continue working on F# 3.0 projects in VS 2013 without retargeting them to 3.1. You should use this if you have a legacy F# 3.0 desktop project that you are not ready to move to 3.1 yet.
  • 2.3.0.0 (F# 3.0/.NET 2) These are the same bits that shipped with VS 2012. The only reason to use this is if you are targeting .NET 2. The .NET 2 side of things is not being developed further, btw - new features, versions, etc will be done for FSharp.Core targeting .NET 4+; the .NET 2 FSharp.Core is still fully supported, but it is frozen.
  • 3.3.1.0 (F# 3.1/"Portable") This version targets .NET portable profile 7 (.NET 4.5/Windows Store). Use this if you are creating a component for a Windows store app and you don't care about Silverlight. This profile is newly supported in VS 2013.
  • 2.3.5.1 (F# 3.1/"Portable (Legacy)") This version targets .NET portable profile 47 (.NET 4/Silverlight 5/Windows Store). Use this if you are creating a Silverlight component. This profile was also supported in VS 2012, and referred to at that time as simply "Portable."
  • 2.3.5.0 (F# 3.0/"Portable (Legacy)") This version targets .NET portable profile 47 (.NET 4/Silverlight 5/Windows Store). These are the same bits that were included in VS 2012. Included in VS 2013 to enable you to continue working on F# 3.0 portable/silverlight projects.

.NET portable profiles are a big PITA and cause a ton of complexity. This site has a good summary to help understand: http://blog.stephencleary.com/2012/05/framework-profiles-in-net.html

So for your specific scenario (new console app) use 4.3.1.0.

Edit 7/2015:

Here's a table that probably explains the story better than the wall of text above. I've tried to use colors to indicate the motivation for the version numbers. You'll see the versioning of the portable libraries was a bit ad hoc and inconsistent in VS 2012 and 2013, but is finally consistent and predictable starting with VS 2015. This is up to date with F# 4.0, which just released.

这篇关于Fsharp.Core 的正确版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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