detecting .net framework

  • Thread starter Thread starter james rowson
  • Start date Start date
J

james rowson

Hi, is there a best-practice way of detecting whether
the .net framework is installed.

The best way I have found so far is checking for a file
(regasm.exe) on a hard-coded path...

The registry doesn't give anything away...

Help!
 
I checked if there is an assembly path in the windows directory :) It's not
a nice way, but it worked for me :)

Cheers
Christian
 
Detecting a particular version or whether or not it is there period? Here is
the registry keys to look for:

There period?
HKLM/Software/Microsoft/.NETFramework

Version 1.1?
HKLM/Software/Microsoft/.NETFramework/policy/v1.1

ASP.NET?
HKLM/Software/Microsoft/ASP.NET

You can detect versions here, like 1.1?
HKLM/Software/Microsoft/ASP.NET/1.1.4322.0

Another possible avenue:
HKCR/.aspx - ASP.NET
HKCR/.cs - C#

If you create an installer, the .NET Framework can be boostrapped to the
installer, relieving your need to programatically check outside of .NET.

http://msdn.microsoft.com/library/en-us/dnnetdep/html/vsredistdeploy1_1.asp -
1.1
http://msdn.microsoft.com/library/en-us/dnnetdep/html/vsredistdeploy.asp -
1.0

http://msdn.microsoft.com/library/en-us/dnnetdep/html/redistdeploy1_1.asp -
general redist article


--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

**********************************************************************
Think Outside the Box!
**********************************************************************
 
Hi James,

I agree with Gregory's reply. In addition, I'd also like to recommend you
the following KB article:

HOW TO: Detect Which Version of the .NET Framework Is Installed in a
Deployment Package
http://support.microsoft.com/?id=315291

Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top