• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 638
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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