Reading registry key throws "Requested registry access is not allowed."

Discussion in 'ASP .Net' started by HK, Apr 1, 2004.

  1. HK

    HK Guest

    I am exceuting the following command in C#

    using Microsoft.Win32;

    RegistryKey key = Registry.LocalMachine.OpenSubKey(KeyName);

    I keep getting the exception "Requested registry access is not
    allowed."

    If i give EVERYONE full access to the key , then i am able open the
    key but i do not want to do that.
    Please help.
    HK, Apr 1, 2004
    #1
    1. Advertising

  2. Give the ASP.NET process access as well as the IUSR account. Either that or
    assign a user for the thread before making the call.

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

    **********************************************************************
    Think Outside the Box!
    **********************************************************************
    "HK" <> wrote in message
    news:...
    > I am exceuting the following command in C#
    >
    > using Microsoft.Win32;
    >
    > RegistryKey key = Registry.LocalMachine.OpenSubKey(KeyName);
    >
    > I keep getting the exception "Requested registry access is not
    > allowed."
    >
    > If i give EVERYONE full access to the key , then i am able open the
    > key but i do not want to do that.
    > Please help.
    Cowboy \(Gregory A. Beamer\), Apr 1, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gary
    Replies:
    2
    Views:
    1,259
    Jeffrey Tan[MSFT]
    Jan 17, 2004
  2. Kovan A.
    Replies:
    0
    Views:
    998
    Kovan A.
    May 31, 2004
  3. =?Utf-8?B?Sm9zaCBGbGFuYWdhbg==?=

    Requested registry access is not allowed.

    =?Utf-8?B?Sm9zaCBGbGFuYWdhbg==?=, Oct 21, 2004, in forum: ASP .Net
    Replies:
    11
    Views:
    8,764
    Alex Drougov
    Nov 5, 2004
  4. Ray5531
    Replies:
    2
    Views:
    6,895
    Ray5531
    May 19, 2005
  5. =?Utf-8?B?YmZwcm9n?=
    Replies:
    3
    Views:
    2,393
    =?Utf-8?B?YmZwcm9n?=
    Aug 19, 2005
Loading...

Share This Page