HighTechTalks DotNet Forums  

Framework version

Dotnet Framework microsoft.public.dotnet.framework


Discuss Framework version in the Dotnet Framework forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Lou
 
Posts: n/a

Default Framework version - 12-09-2007 , 09:36 AM






How can I programmatically get the current framework version?
-Lou



Reply With Quote
  #2  
Old   
VistaDB
 
Posts: n/a

Default Re: Framework version - 12-28-2007 , 01:42 PM







Quote:
System.Environment.Versionwill get you the CLR version loaded into
the process (so it will be 2.0 even if you use 3.x libraries).
Why is that so? Even if I build a new app under VS 2008 with 3.5 as
the target the Environment.Version returns 2.0....



Reply With Quote
  #3  
Old   
Peter Duniho
 
Posts: n/a

Default Re: Framework version - 12-28-2007 , 01:56 PM



On Fri, 28 Dec 2007 11:42:28 -0800, VistaDB <vistadb (AT) gmail (DOT) com> wrote:

Quote:
System.Environment.Versionwill get you the CLR version loaded into
the process (so it will be 2.0 even if you use 3.x libraries).

Why is that so? Even if I build a new app under VS 2008 with 3.5 as
the target the Environment.Version returns 2.0....
That's correct. It's because the CLR version hasn't changed, even though
the marketing version for .NET has. .NET 3.0 and 3.5 are still using CLR
2.0, they just have new classes and other features (like a new C# version).

I do think it's a little confusing, but to some extent the question of the
overall .NET version isn't so important since if your application depends
on a specific version it won't get far enough when loading for execution
to get a chance to check the CLR version, and at least for .NET 3.0 and
3.5 there aren't any additions that should affect your own code the way
that a change in the CLR version could.

Pete


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.