Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

F# and .Net versions

Tags:

.net

msbuild

f#

I'm writing a program in F# at the moment, which I specified in the Visual Studio project setup to target .Net 3.5, this being the highest offered, on the theory that I might as well get the best available.

Then I tried just now running the compiled program on an XP box, not expecting it to work, but just to see what would happen. Unsurprisingly I just got an error message demanding an appropriate version of the framework, but surprisingly it wasn't 3.5 it demanded, but 2.0.50727.

An additional puzzle is the version of MSBuild I'm using to compile the release version of the program, which I found in the framework 3.5 directory but claims to be framework 2.0 and build engine 3.5. I just guessed it was the right version of MSBuild to use because it seemed to correspond with the highest framework version F# seems to be able to target, but should I be using a different version? Anyone have any idea what's 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
like image 757
rwallace Avatar asked Dec 18 '22 00:12

rwallace


1 Answers

It is because .NET versions are a bit confusing. The languages, the runtime and the library itself all have separate version numbers. .NET 3.5 runs on version 2.0 of the runtime and is really just a collection of additional assemblies. If you don't reference any of the new assemblies, you application is essentially a 2.0 application as the core for .NET 3.5 is 2.0.

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

The wiki article on .NET has more details on this.

like image 96
Brian Rasmussen Avatar answered Feb 27 '23 15:02

Brian Rasmussen