Determining .NET Install Directories

J

John Puopolo

All:

This *should* be a simple question, but I cannot find a definitive answer on
the net so....

I have both versions 1.1 and versions 2.0 of the CLR/.NET installed on my
machine. I want to get a list of the root directories under which these
live. I can use the following statments to get the most recent info...

System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory();
System.Runtime.InteropServices.RuntimeEnvironment.GetSystemVersion();

However, how do I get a list (similar to what these methods yield) for the
v1.1 as well? In other words, is there a definitive way to iterate the .NET
installation dirs?

Thanks,
John
 
M

Mujtaba Syed

Using the config file, make the version whose root directories your need, a "required" version.

<configuration>
<startup>
<requiredRuntime version="1.0.3705"/>
</startup>
</configuration>

Mujtaba.
 
C

Carlos J. Quintero [.NET MVP]

The registry entry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework,
InstallRoot tells you the home directory of .NET Frameworks.

The registry entry
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\policy tells you the
versions installed.

--

Carlos J. Quintero

MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top