• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 644
  • Last Modified:

Getting GACUTIL.exe Location from the registry

Hi,

 I want a code that gets the location file for registering assembly (gacutil.exe) and (sn.exe) from the registry (regedit.exe) ,
Any one have a code for this?

Thanks.
0
mubama0n
Asked:
mubama0n
  • 5
  • 4
1 Solution
 
rajaloysiousCommented:
RegistryKey rkey = Registry.LocalMachine.OpenSubKey("<KEYNAME>");
string sPath = rkey.GetValue("<VALUENAME>").ToString();

cheers
0
 
rajaloysiousCommented:
hope this is of help to you...

SDKFolder\bin\gacutil.exe
SDKFolder\bin\sn.exe

where SDK folder can be got in the following manner

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework]
"sdkInstallRootv1.1"

RegistryKey rkey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\.NETFramework");
string sGACPath = rkey.GetValue("sdkInstallRootv1.1").ToString();

cheers
0
 
mubama0nAuthor Commented:
RegistryKey ? give me compile error?
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
mubama0nAuthor Commented:
using ??
0
 
mubama0nAuthor Commented:
I mean for which name spcae?
0
 
mubama0nAuthor Commented:
I mean for which name spcae (RegistryKey )?
0
 
rajaloysiousCommented:
using Microsoft.Win32;
0
 
mubama0nAuthor Commented:
It says:
 The type or namespace name 'RegisetryKey' could not be found (are you missing a using directive or an assembly reference?)

D:\practic\ServerUpdate\10711\Form1.cs(184): The type or namespace name 'rkey' could not be found (are you missing a using directive or an assembly reference?)


I wrote like you said (using Microsoft.Win32;)?
0
 
RomanPetrenkoCommented:
not 'RegisetryKey' but RegistryKey - looks like mistype in your code.
0
 
rajaloysiousCommented:
??
guess i never gave 'RegisetryKey' in my posts...

cheers...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now