Version F # and .Net

I am writing a program in F # at the moment, which I indicated in setting up the Visual Studio project for targeting .Net 3.5, which is the highest offer, in theory, that I could also get the best accessibility.

Then I tried to just run the compiled program in the XP window, not expecting it to work, but just to see what happens. It is not surprising that I got an error message that required an appropriate version of the framework, but surprisingly it required not 3.5, but 2.0.50727.

An additional puzzle is the version of MSBuild that I use to compile the version of the version of the program that I found in the framework directory 3.5, but claims to be a framework 2.0 and a build mechanism 3.5. I just guessed that it was the correct version of MSBuild because it seemed to match the highest version of the F # frame, which might be targeted, but should I use a different version? Does anyone know what is going on?

C:\Windows>dir/s msbuild.exe Volume in drive C is OS Volume Serial Number is 0422-C2D0 Directory of C:\Windows\Microsoft.NET\Framework\v2.0.50727 27/07/2008 19:03 69,632 MSBuild.exe 1 File(s) 69,632 bytes Directory of C:\Windows\Microsoft.NET\Framework\v3.5 29/07/2008 23:40 91,136 MSBuild.exe 1 File(s) 91,136 bytes Directory of C:\Windows\Microsoft.NET\Framework\v4.0.30319 18/03/2010 16:47 132,944 MSBuild.exe 1 File(s) 132,944 bytes Directory of C:\Windows\winsxs\x86_msbuild_b03f5f7f11d50a3a_6.0.6000.16386_none_815e96e1b0e084be 20/10/2006 02:14 69,632 MSBuild.exe 1 File(s) 69,632 bytes Directory of C:\Windows\winsxs\x86_msbuild_b03f5f7f11d50a3a_6.0.6000.16720_none_81591d45b0e55432 27/07/2008 19:00 69,632 MSBuild.exe 1 File(s) 69,632 bytes Directory of C:\Windows\winsxs\x86_msbuild_b03f5f7f11d50a3a_6.0.6000.20883_none_6a9133e9ca879925 27/07/2008 18:55 69,632 MSBuild.exe 1 File(s) 69,632 bytes C:\Windows>cd Microsoft.NET\Framework\v3.5 C:\Windows\Microsoft.NET\Framework\v3.5>msbuild /ver Microsoft (R) Build Engine Version 3.5.30729.1 [Microsoft .NET Framework, Version 2.0.50727.3053] Copyright (C) Microsoft Corporation 2007. All rights reserved. 3.5.30729.1 
+4
source share
2 answers

This is because .NET versions are a bit confusing. Languages, the runtime, and the library itself have separate version numbers .. NET 3.5 runs on version 2.0 of the runtime and is simply a collection of additional assemblies. If you are not referencing any of the new builds, you are essentially a 2.0 application, since the core for .NET 3.5 is 2.0.

Fortunately, with the latest version, the library, runtime, and C # are all called version 4.

The .NET wiki article provides more details on this.

+8
source

As for F # more specifically, two versions are currently available:

  • The version that comes with Visual Studio 2010 is the last thing you can get and is for .NET 4.0 (this is a completely new version of the runtime, as Brian points out). This version of F # is based on some features available in the .NET 4.0 libraries, so F # programs compiled for .NET 4.0 will not work on .NET 2.0.

  • Version for Visual Studio 2008 (also called CTP). This version produces assemblies compatible with runtime 2.0 (which is also used by .NET 3.0 and 3.5). If you use only .NET 2.0 assemblies, your application will run on .NET 2.0, but if you use WPF (.NET 3.0) or LINQ (.NET 3.5), your application will need a newer .NET.

In any case, F # applications must also be distributed using FSharp.Core.dll (for .NET 4.0 or 2.0), which is the F # runtime (containing some functions that are necessary for F # programs but are not available in .NET, regardless of version).

+4
source

Source: https://habr.com/ru/post/1311333/


All Articles