简体   繁体   English

F#3.1是否需要安装特定的运行时?

[英]Does F# 3.1 require a specific runtime to be installed?

I've written some Visual Studio extensions that support VS2012+VS2013. 我编写了一些支持VS2012 + VS2013的Visual Studio扩展。 I'd like to use F# in them; 我想在其中使用F#; and I'm a little confused about the target runtimes... 我对目标运行时有点困惑......

I'm targetting .NET 4.5 (not 4.5.1), but I can also select between F# 3.0 and 3.1. 我的目标是.NET 4.5(不是4.5.1),但我也可以选择F#3.0和3.1。 I'm aware F# 3.1 shipped with VS2013 (and .NET 4.5.1), so I'm not sure if: 我知道F#3.1附带VS2013(和.NET 4.5.1),所以我不确定是否:

  1. Can I use F# 3.1 and .NET 4.5, or does F# 3.1 require .NET 4.5.1? 我可以使用F#3.1和.NET 4.5,还是F#3.1需要.NET 4.5.1? (VS lets me pick this combination) (VS让我选择这个组合)
  2. Will a project targeting F# 3.1 work on a machine with VS2012 and no newer runtimes installed? 针对F#3.1的项目是否可以在安装了VS2012且没有安装新运行时的计算机上运行? I saw a blog post that mentioned an "F# runtime"; 我看到一篇博文提到了“F#运行时”; but FSharp.Core.dll gets included in my build, so it's unclear whether that's enough to use 3.1? 但FSharp.Core.dll包含在我的构建中,所以目前还不清楚这是否足以使用3.1?

(Targetting 3.0 is no big deal; there doesn't seem to be a massive amount in 3.1; but it'd be useful to know how these things relate). (目标3.0没什么大不了的; 3.1中似乎没有大量数据;但了解这些事情的相关性是有用的)。

To answer 1: 回答1:

Can I use F# 3.1 and .NET 4.5, or does F# 3.1 require .NET 4.5.1? 我可以使用F#3.1和.NET 4.5,还是F#3.1需要.NET 4.5.1? (VS lets me pick this combination) (VS让我选择这个组合)

Yes, you can 是的你可以

  • 4.3.1.0 (F# 3.1/.NET 4) This is the most recent official version. 4.3.1.0(F#3.1 / .NET 4)这是最新的官方版本。 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. 除非您要求以.NET 2为目标,或者您正在使用一些不能与3.1一起使用的旧版F#组件,否则这是您应该用于任何新桌面应用程序的版本。
  • 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. 4.3.0.0(F#3.0 / .NET 4)这些是与VS 2012一起提供的相同位。它包含在内,因此您可以继续在VS 2013中处理F#3.0项目,而无需将它们重新定位到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. 如果您有一个尚未准备好迁移到3.1的旧版F#3.0桌面项目,则应使用此项。

To answer 2: 回答2:

You can open and work with F# projects that were created in Visual Studio 2013 or Visual Studio 2012 in either version of Visual Studio, without making any modifications. 您可以在任何版本的Visual Studio中打开和使用在Visual Studio 2013或Visual Studio 2012中创建的F#项目,而无需进行任何修改。 The only exception is that, the first time that you open a Visual Studio 2012 project in Visual Studio 2013, Visual Studio makes a small change to enable the project to be used in both versions. 唯一的例外是,第一次在Visual Studio 2013中打开Visual Studio 2012项目时,Visual Studio会进行一些小的更改,以使项目能够在两个版本中使用。 This capability is known as round-tripping. 此功能称为往返。 You can specify which version of the F# runtime (and core library) you want to target on the Application tab of the project's properties. 您可以在项目属性的“应用程序”选项卡上指定要定位到哪个版本的F#运行时(和核心库)。 Choose F# 3.0 if you're creating a library that must run in many contexts or you want to participate in project round-tripping. 如果您要创建一个必须在许多上下文中运行的库,或者您想要参与项目往返,请选择F#3.0。 If you choose F# 3.0, you won't be able to use any of the language features that are new in F# 3.1, such as named union cases and enhanced array slicing. 如果选择F#3.0,则无法使用F#3.1中新增的任何语言功能,例如命名的联合案例和增强的数组切片。 If you change the target runtime to F# 3.1, you can't reopen the project in Visual Studio 2012. 如果将目标运行时更改为F#3.1,则无法在Visual Studio 2012中重新打开该项目。

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

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