Question

I've written some Visual Studio extensions that support VS2012+VS2013. I'd like to use F# in them; 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. I'm aware F# 3.1 shipped with VS2013 (and .NET 4.5.1), so I'm not sure if:

  1. Can I use F# 3.1 and .NET 4.5, or does F# 3.1 require .NET 4.5.1? (VS lets me pick this combination)
  2. Will a project targeting F# 3.1 work on a machine with VS2012 and no newer runtimes installed? I saw a blog post that mentioned an "F# runtime"; but FSharp.Core.dll gets included in my build, so it's unclear whether that's enough to use 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).

Was it helpful?

Solution

To answer 1:

Can I use F# 3.1 and .NET 4.5, or does F# 3.1 require .NET 4.5.1? (VS lets me pick this combination)

Yes, you can

  • 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.

To answer 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. 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. 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. 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. 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. If you change the target runtime to F# 3.1, you can’t reopen the project in Visual Studio 2012.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top