Does f# 4.0 support .net 3.5? - f#

Can I use 4.0 compiler to create .net 3.5 dll?
Or the minimal .net version is 4.5?
Also, could the latest version of FSharp.Core be used with .net 3.5?

If you select .NET Framework 4 as the Target Framework in Visual Studio, the only F# version you can pick is F# 3.0:
If, on the other hand, you select .NET Framework 4.5, the option to pick F# 4.0 becomes available as well.
Based on that, it looks as though .NET 4.5 is the minimum version for F# 4. That's only Visual Studio's view, though, so it may be possible that you can use F# 4 with older versions of .NET using other development tools.
If you look at the NuGet page for FSharp.Core 4.0.0.1 (currently the most recent version), you'll see that it supports these frameworks:
.NET 2.0
.NET 4.0
.NET Portable Profile 7 (portable-net45+netcore45)
.NET Portable Profile 47 (portable-net45+sl5+netcore45)
.NET Portable Profile 78 (portable-net45+netcore45+wp8)
.NET Portable Profile 259 (portable-net45+netcore45+wpa81+wp8)

Related

I cannot change the Target Framework from .NET 5.0 to .NET 4.8 for a C# .NET Framework Class Library in Visual Studio 2019

I am trying to build a .NET 4.8 Class Library that I can make COM-Visible as a support library from an Access application.
There are no prompts for the version of .NET Framework when I create the solution.
When I look at the Project Properties, the .NET Framework is set to 5.0.
Although I have the .NET Framework 4.8 installed, it does not appear in the combo-box for the Target framework. The only options are shown below.
I have also noticed that the Startup object combobox does not reflect the selected startup assembly.
Do I need to drop back to Visual Studio 2017 to create a .NET Framework 4.8 library?
Which SDK is installed?
If you only have the .net 5 SDK installed, it might suffice for making a .net core 3 app but it will not cover .net Framework.
Install the .net Framework SDK for the version you want to target.
And/or install a targeting pack if you want to target .net 4.8 and 4.7.2 for example.
(Maybe helpful: What's the difference between the .NET Framework SDK and the Targeting pack)
This happened to me because I had choosen the wrong kind of project.
I had choosen a project library for C#, Windows Linux, macOS.
By this the same thing, that one could only had .NET 5.0 and higher as Framework.
I had to create a new library project with only C# and Windows.
Than I could choose all installed .NET frameworks

Visual Studio 2019 16.18.4 : .NET 5.0 installed yet not available for projects?

I have Visual Studio 2019 updated to the latest current version of 16.18.4 (see screenshot), the .NET 5.0 is installed (see screenshot made in visual studio installer) and yet when creating new projects or then changing
target framework, the .NET 5.0 framework is not available. In the about box Visual Studio displayed .NET 4.8, not .NET 5.0.
To help anyone else who might face a moment of confusion as I did, the following allows creating a .NET Framework Windows Forms project
while the following allows targeting either .NET Core 3.1 or the newer .NET 5.0
and, as said, you can't simply set from VS a .NET Framework project to target the new .NET 5.0.

How to create a C# version 9.0 Application with Visual Studio 2019

I am trying (unsuccessfully) to create a Console Application that targets .Net 5.0 so that I can use C# Version 9.0.
Although I have installed the .Net 5.0 I am unable to select it when creating a project.
I would like to use some of the new features of C# 9 but this requires version 5.0 of .Net as I understand it.
I am using Visual Studio 2019 Version 16.8.3
Thanks
Right click on the csproj and make sure it looks like this:
<PropertyGroup>
<OutputType>Exe</OutputType>
<LangVersion>latest</LangVersion>
<TargetFrameworks>net5.0</TargetFrameworks>
...
</PropertyGroup>
If you don't see .NET 5 in the Target Frameworks for a .NET Core Application, you don't have the installation correct. Here's what mine looks like
C# 9 is only available on .NET 5 (which is .NET Core not .NET Framework).
C# 9.0 is supported only on .NET 5 and newer versions.
https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/configure-language-version
.NET 5.0 is the next major release of .NET Core following 3.1. We
named this new release .NET 5.0 instead of .NET Core 4.0 for two
reasons:
We skipped version numbers 4.x to avoid confusion with .NET Framework
4.x.
We dropped "Core" from the name to emphasize that this is the main implementation of .NET going forward. .NET 5.0 supports more
types of apps and more platforms than .NET Core or .NET Framework.
https://learn.microsoft.com/en-us/dotnet/core/dotnet-five

Visual Studio 2019 IntelliTest Compatibility With .NET Core, .NET Standard?

I'm evaluating Intellitest in the latest version of Visual Studio Enterprise. As far as I can tell from my own attempts and research on various sites, it appears like IntelliTest is only compatible with .NET Framework - not .NET Standard, nor .NET Core.
Is this correct?
As per today's version (16.4.4) this seems correct. There is an open issue at https://developercommunity.visualstudio.com/idea/359250/add-intellitest-support-for-net-corestandard.html which will add/fix the Intellitest option for .NET core and .NET Standard. You can help by upvoting that item in order to have it prioritized.
Correct, they are not supported yet!
Note
IntelliTest is available in Enterprise edition only. It is supported for C# code that targets the .NET Framework. .NET Core and .NET Standard are not currently supported.
Source: Overview of Microsoft IntelliTest
TL&DR: Visual Studio Enterprise 2022 still does NOT have support for Dotnet Core
IntelliTest is available in Enterprise edition only. It is supported
for C# code that targets the .NET Framework. .NET Core and .NET
Standard are not currently supported.
https://learn.microsoft.com/en-us/visualstudio/test/intellitest-manual/?view=vs-2022

Correct version of Fsharp.Core

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 Assemblies\Microsoft\FSharp).
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.
Today I would probably rather follow these guidelines
In short, you can/should reference FSharp.Core from NuGet

Resources