In a web site targeted for Framework 3.5, on a machine with up to 3.5 SP 1 installed, when I call System.Environment.Version in a page, it reports 2.0.50727.3053. Can anyone suggest why this happens?
Asked
Active
Viewed 1,118 times
3 Answers
7
It is telling you the CLR version, which is still 2.0x; it jumps to 4.0x in .NET 4.0 - but until then, all of .NET 2.0, .NET 3.0 and .NET 3.5 share a CLR version (give-or-take the small numbers ;-p)

Marc Gravell
- 1,026,079
- 266
- 2,566
- 2,900
2
Because the underlying CLR for .NET framework 3.5 is still 2.0.50727.3053.
.NET 3.0 and 3.5 are additions to .NET 2.0 - the underlying CLR is still the same.
This will change with .NET 4.0 with a new CLR 4.0.
Marc

marc_s
- 732,580
- 175
- 1,330
- 1,459
1
The MSDN docs for Environment.Version say this:
Gets a Version object that describes the major, minor, build, and revision numbers of the common language runtime.
The CLR version in 3.5 SP1 is still 2.0.
Hence, no error, it behaves exactly as documented.

Mihai Limbășan
- 64,368
- 4
- 48
- 59
-
1Hmm, I wouldn't say 'no error' - I'd say 'howling, screaming cock-up' - but that's on MS's part, no the OP's... :-) – Will Dean Apr 02 '09 at 08:05
-
I don't know... If they'd called this property "FrameworkVersion" and then returned the CLR version I'd be pissed - but as it is now the name is OK (though a bit generic) and the docs are clear. They could conceivably add a clarification ("This is NOT the framework version!"), but still. – Mihai Limbășan Apr 02 '09 at 09:53
-
It's not the name or the value of the property I object to, it's particularly the 3.5->3.5SP1->3.5SP1GDR progression which seems so badly handled. – Will Dean Apr 02 '09 at 10:06