The .NET framework is a bit confusing until you get your head round the components of it, and the way that Microsoft name things.
.NET has a thing called the common language runtime (CLR). (This is the .NET equivalent of the Java Runtime). Different versions are essentially different VMs, and can coexist. The CLR runs code that is an Intermediate Language (IL) (aka the Common Intermediate Language (CIL)). Whatever code you write in C# or VB.NET actually only gets partially compiled into IL code. It’s a lot like Java Bytecode.
The Base Classes are the library of DLLs for the framework (and are sometimes incorrectly referred to as the framework). Think of it as Win32 for .NET. These constitute the .NET API – and have different versions too. A different version of the base classes, though, does not mean a different CLR – for example, frameworks version 2, 3 and 3.5 all use the same CLR, but present a different external API and have different language features. Indeed, the base classes of framework version 3.5 are a superset of version 3, which are a superset of 2. This means framework 2 code will run on machines with the 3.5 installed.
(Note to self – must remember – C# version is independent of Framework version)
|
|
Framework Version 1.1 |
Framework Version 2.0 |
Framework Version 3 |
Framework Version 3.5 |
|
CLR |
1.1 |
2.0 |
2.0 |
2.0 |
|
Library versions |
1.1 |
2.0 |
3.0 (including 2.0 sp1) |
3.5 (including 2.0 sp1 & 3.0 sp1) |
Similar chart here:
http://www.leonmeijer.nl/archive/2007/06/11/50.aspx
…though the Microsoft guy who presented to me didn’t say anything about a CLR 3.0. I suppose there may be one which is backwardly compatibile?
Thanks for the links.
To be precise:
1. all your references to 2.0 and 3.0 under 3.5, should be 2.0 SP1 and 3.0 SP1.
2. The compiler verison used is irrelevant to the Framework version. It is driven from the IDE: if it is VS2005, then it is C# 2.0. If it is VS2008, then it is C# 3.0
No problem – thanks for the presentation, it was interesting. Sorry it took so long to actually get to blogging about it!
Yes, forgot about the ‘SP1′ part – fixed. And fair point about the compiler version. I was just interested that you could write code in Visual Studio 2008 using C# 3.0 and then run it in the CLR 2.0 (if I understood correctly). That’s neat!