tags:

views:

1112

answers:

9

What are the different ways (programatically & otherwise) to determine what versions of .NET are running on a system?

+4  A: 

Directly from the source.

How to detect the installed version of the .NET framework

Torlack
A: 

Get the smallest .NET Framework download possible that will tell you based on the headers you are sending. It only works on Internet Explorer or if you have the Firefox extension installed. More info in Hanselman's blog post.

Darren Kopp
A: 

Some advice here: http://support.microsoft.com/kb/318785

And here is a little app that will give you even more information: dotnet version checker

Martin
A note: the dotnet version checker, as of my writing this comment, detects v3.0 but not v3.5 ... bummer.
quux
+3  A: 

Hurray for Google: Using managed code to detect what .NET Framework versions and service packs are installed

Omer van Kloeten
link fix: http://www.codeproject.com/KB/dotnet/frameworkversiondetection.aspx
Sven Hecht
A: 

If you're using IIS6 and above, open up IIS and click on Web Service Extensions. It will list each framework installed. Granted, .NET 3.0 and 3.5 are both based on the 2.0 framework.

chrisofspades
A: 

If you're wanting the current framework version in use then you can see that via:

System.Environment.Version
Ryan Farley
A: 

It's not necessarily running I would say. Since you can have .NET 1.1, 2.0, 3.0 and 3.5 installed on the same machine and they can run perfectly side-by-side. Meaning one of your app can be running on top of 1.1 and another web application is running on 2.0.

In IIS (for web app), this is quite easy, just go to the property of the virtual directory / application and go to the ASP.NET tab, you should see what version of .NET you are actually using (or rather, what version of ASP.NET which is pretty much tied into the .NET Framework version).

ps. just remember, you can only run 1 version of .NET Framework per application pool in IIS. So if you try to use the same application pool to run different versions of the framework, you're in for a surprise. Solution is to just create a framework version specific application pool (i.e. one pool for all 1.1 framework and another for 2.0 framework)

Jimmy Chandra
A: 

Take a look at this thread.

Scott Dorman
A: 

I found this link much more usable: http://www.walkernews.net/2008/05/16/how-to-check-net-framework-version-installed/

Essentially, open IE, and paste this into the address bar: javascript:alert(navigator.userAgent) ... don't know if it always works, or if it is complete, but it works for my uses, doesn't require a lot of extra reading, and works without installing anything additional.

cognitiaclaeves