How can I detect if ASP.NET is registered or not (programmatically)?

I've read a lot of posts about checking register, for example:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ASP.NET\..., but I have not this key at all, and
about existing the folder "C:\Inetpub\wwwroot\aspnet_client"(but it can be absent)

Also I can't use the Metabase.xml because it has different structure for IIS 6.0 and 7.0.

I need errorless variant to detect it.

Thanks, Ekaterina

Thanks for answer, but I've mentioned in my previous question that I have registered ASP.NET but keys (e.g .NET 2.0 - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ASP.NET\2.0.50727.0) are absent in my registry.

hmmm very weird

try this then
from your .net framework folder, normally
c:\windows\Microsoft.NET\Framework\v2.0.50727 (may be different version)

run this

aspnet_regiis.exe -lv

aspnet_regiis -lv :
2.0.50727.0 Valid (Root) C:\WIN64\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll

But If I uninstall all version of ASP.NET: (aspnet_regiis -ua) I will get just message after calling aspnet_regiis -lv : "Cannot find any installed version" and this is not useful for localized system(if check string after calling command)

maybe i just don't get what you are wanting

you said you wanted to know if asp.net was registered or not, i don't get what you are wanting past that

let me know and i'll do my best to help

I want to detect if ASP.NET is registered or not from code? It is very important that just from code. May be you know appropriate API to do this (.NET), because I can't find suitable one.

Cant you use WMI to query the IIS server to see if it has support for ASP and/or ASP.NET scripting?

To: jbennet
Thanks for the answer. I've looked over the sites (e.g http://blog.crowe.co.nz/archive/2006/07/04/663.aspx, http://blog.crowe.co.nz/archive/2006/06/01/644.aspx) but all examples read info from MetaBase.xml. The "ScriptMaps" property chages after install/uninstall ASP.NET, but it very difficult to detect what scripts must be present here. There is not more clear property to define it. Help me if I am mistaken.

To dickersonka:
I tried to use this approach but It is difficult to parse output in localized systems. These commands return message string e.g "Cannot find any installed version", but how to parse it from different languages?.

To sierrainfo:
Thanks for answer, but I have not any key under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ASP.NET\.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.