equested registry access is not allowed (using Enterprise Library)

Discussion in 'ASP .Net Security' started by Andrés Cadavid Gómez, Aug 5, 2005.

  1. Hello,

    im using the enterpirse Library - July 2005 and when i had published my
    application in the production server, i got this error:

    Exception Details: System.Security.SecurityException: Requested registry
    access is not allowed.

    Im using the configuration, data, exception blocks.

    Can anyone help me what i do ?

    I cant modify the server registry, i need a solution with least privilege
    possible.

    Thank you.
     
    Andrés Cadavid Gómez, Aug 5, 2005
    #1
    1. Advertising

  2. August 6, 2005

    You will need to grant access in two ways:

    #1 through Code Access Security
    #2 Set the appropriate NTFS permissions

    To start with #2, do you need widespread access to the registry? If you only
    need to access a few nodes, you can type RegEdit at the Run prompt and then
    scroll to your node and set the permissions you need by going to the
    Security tab on the Properties page.

    For #1, the method depends on how you have your machine configured. For
    starters, what setting do you have your web application running from?
    Trusted Sites, Intranet, etc?

    Hope this helps you!

    --
    Joseph Bittman
    Microsoft Certified Solution Developer

    Web Site: http://71.39.42.23
    Static IP




    "Andrés Cadavid Gómez" <> wrote in
    message news:...
    > Hello,
    >
    > im using the enterpirse Library - July 2005 and when i had published my
    > application in the production server, i got this error:
    >
    > Exception Details: System.Security.SecurityException: Requested registry
    > access is not allowed.
    >
    > Im using the configuration, data, exception blocks.
    >
    > Can anyone help me what i do ?
    >
    > I cant modify the server registry, i need a solution with least privilege
    > possible.
    >
    > Thank you.
     
    Joseph Bittman MCSD, Aug 6, 2005
    #2
    1. Advertising

  3. Andrés Cadavid Gómez

    Guest

    I am having the same problem. Could please post your final solution?
    Thanks.
     
    , Aug 12, 2005
    #3
  4. Is Enterprise Library trying to create an event log when this happens? This
    problem is very common with code that attempts to create an event log since
    that operation requires administrative privileges and the web application
    generally does not have them.

    Joe K.

    <> wrote in message
    news:...
    >I am having the same problem. Could please post your final solution?
    > Thanks.
    >
     
    Joe Kaplan \(MVP - ADSI\), Aug 12, 2005
    #4
  5. Andrés Cadavid Gómez

    Guest

    Yes, I figured out this part.

    It is trying to create an Event Source "Enterprise Library
    Instrumentation"

    So I went to the Registry and manually created this Key:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\Enterprise
    Library Instrumentation.

    After the registry key is created. The program does NOT get the
    SecurityException anymore.

    BUT, now I get error in the event log:

    The description for Event ID ( 0 ) in Source ( Enterprise Library
    Instrumentation ) cannot be found. The local computer may not have the
    necessary registry information or message DLL files to display messages
    from a remote computer. You may be able to use the /AUXSOURCE= flag to
    retrieve this description; see Help and Support for details. The
    following information is part of the event: Failed to create instances
    of performance counter 'Total Command Executions' - The requested
    Performance Counter is not a custom counter, it has to be initialized
    as ReadOnly...

    My guess is that I have to run the InstallService.bat. But I don't have
    anything on the server - no VStudio, Enterprise Library source.

    Any insight?

    John
     
    , Aug 12, 2005
    #5
  6. I can't remember the details, but Ent Lib is supposed to be set up on the
    machine it is being run on BEFORE you start actually using it. This set up
    installs the event logs, perf counters and WMI info in advance. There is a
    tool that comes with Ent Lib that will do this for you. If that is not done
    in advance, it tries to do that for you, but may fail due to security
    limitations.

    The other alternative is to create a build of Ent Lib with all of the
    instrumentation turned off (which can be done with a preprocessor variable
    as I recall).

    I'm sure there are tons of posts covering this stuff over at the ent lib
    forum at www.gotdotnet.com or probably even in the docs that came with it.

    Joe K.

    <> wrote in message
    news:...
    > Yes, I figured out this part.
    >
    > It is trying to create an Event Source "Enterprise Library
    > Instrumentation"
    >
    > So I went to the Registry and manually created this Key:
    >
    > HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\Enterprise
    > Library Instrumentation.
    >
    > After the registry key is created. The program does NOT get the
    > SecurityException anymore.
    >
    > BUT, now I get error in the event log:
    >
    > The description for Event ID ( 0 ) in Source ( Enterprise Library
    > Instrumentation ) cannot be found. The local computer may not have the
    > necessary registry information or message DLL files to display messages
    > from a remote computer. You may be able to use the /AUXSOURCE= flag to
    > retrieve this description; see Help and Support for details. The
    > following information is part of the event: Failed to create instances
    > of performance counter 'Total Command Executions' - The requested
    > Performance Counter is not a custom counter, it has to be initialized
    > as ReadOnly...
    >
    > My guess is that I have to run the InstallService.bat. But I don't have
    > anything on the server - no VStudio, Enterprise Library source.
    >
    > Any insight?
    >
    > John
    >
     
    Joe Kaplan \(MVP - ADSI\), Aug 12, 2005
    #6
  7. Andrés Cadavid Gómez

    Guest

    I am back on this issue and finally found the solution.

    Run the InstallUtil against each assembly.

    What I did is follow the same step as InstallService.bat so I won't
    miss anything. The InstallService.bat refers to the Visual Studio which
    I don't have it on the server.
     
    , Aug 23, 2005
    #7
    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,267
    Jeffrey Tan[MSFT]
    Jan 17, 2004
  2. HK
    Replies:
    1
    Views:
    3,649
    Cowboy \(Gregory A. Beamer\)
    Apr 1, 2004
  3. Kovan A.
    Replies:
    0
    Views:
    1,003
    Kovan A.
    May 31, 2004
  4. =?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,791
    Alex Drougov
    Nov 5, 2004
  5. Ray5531
    Replies:
    2
    Views:
    6,906
    Ray5531
    May 19, 2005
Loading...

Share This Page