System.Security.SecurityException: Requested registry access is no

Discussion in 'ASP .Net Security' started by Tim Reynolds, May 19, 2005.

  1. Tim Reynolds

    Tim Reynolds Guest

    Using Web Service to raise Event, for Enterpise Instrumentation (EIF) to
    write to Application Log (in event viewer). I just reimaged my pC - so trying
    to get it set up - I had it setup before using Win 2000 and don't remember
    hitting this error. Now I'm on XP Pro, and seeing:
    Error loading an Event Sink of type
    'Microsoft.ApplicationBlocks.Logging.EventSinks.LogEventSink,
    Microsoft.ApplicationBlocks.Logging.EventSinks, Version=1.0.0.0,
    Culture=neutral, PublicKeyToken=da59d79eb5fd8f1a'. The Event Source of name
    'Application' will not write events out to this Event Sink. The following
    exception was returned during the load:

    System.Reflection.TargetInvocationException: Exception has been thrown by
    the target of an invocation. ---> System.Security.SecurityException:
    Requested registry access is not allowed.
    at Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable)
    at System.Diagnostics.EventLog.FindSourceRegistration(String source,
    String machineName, Boolean readOnly)
    at System.Diagnostics.EventLog.SourceExists(String source, String
    machineName)
    at System.Diagnostics.EventLog.SourceExists(String source)
    at
    Microsoft.ApplicationBlocks.Logging.EventSinks.LogEventSink.CreateEventSource()
    at
    Microsoft.ApplicationBlocks.Logging.EventSinks.LogEventSink..ctor(IDictionary
    parameters, EventSource eventSource)
    --- End of inner exception stack trace ---


    Please assists - Thanks.
    I've heard I shouldn't make ASPNET ID administrator for security reasons, so
    I don't want to go that route.

    WHat can I do?

    Thanks,
    Tim
    Verizon
    Tim Reynolds, May 19, 2005
    #1
    1. Advertising

  2. Tim Reynolds

    Tim Reynolds Guest

    Other symptom is getting 2035 when trying to read MQ under this web service.
    Both issues I didn't have before. ....

    "Tim Reynolds" wrote:

    > Using Web Service to raise Event, for Enterpise Instrumentation (EIF) to
    > write to Application Log (in event viewer). I just reimaged my pC - so trying
    > to get it set up - I had it setup before using Win 2000 and don't remember
    > hitting this error. Now I'm on XP Pro, and seeing:
    > Error loading an Event Sink of type
    > 'Microsoft.ApplicationBlocks.Logging.EventSinks.LogEventSink,
    > Microsoft.ApplicationBlocks.Logging.EventSinks, Version=1.0.0.0,
    > Culture=neutral, PublicKeyToken=da59d79eb5fd8f1a'. The Event Source of name
    > 'Application' will not write events out to this Event Sink. The following
    > exception was returned during the load:
    >
    > System.Reflection.TargetInvocationException: Exception has been thrown by
    > the target of an invocation. ---> System.Security.SecurityException:
    > Requested registry access is not allowed.
    > at Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable)
    > at System.Diagnostics.EventLog.FindSourceRegistration(String source,
    > String machineName, Boolean readOnly)
    > at System.Diagnostics.EventLog.SourceExists(String source, String
    > machineName)
    > at System.Diagnostics.EventLog.SourceExists(String source)
    > at
    > Microsoft.ApplicationBlocks.Logging.EventSinks.LogEventSink.CreateEventSource()
    > at
    > Microsoft.ApplicationBlocks.Logging.EventSinks.LogEventSink..ctor(IDictionary
    > parameters, EventSource eventSource)
    > --- End of inner exception stack trace ---
    >
    >
    > Please assists - Thanks.
    > I've heard I shouldn't make ASPNET ID administrator for security reasons, so
    > I don't want to go that route.
    >
    > WHat can I do?
    >
    > Thanks,
    > Tim
    > Verizon
    >
    Tim Reynolds, May 20, 2005
    #2
    1. Advertising

  3. You need to ensure that the event source is registered under an admin
    account before you attempt to write to it from a low-privilege account. If
    this is your development machine, just run a little console app under an
    admin account to create the event log source. This requires only one line
    of code: System.Diagnostics.EventLog.CreateEventSource("SourceName",
    "LogName"). Registration of the event source should also be added to your
    application's installer, which would presumably be run under an admin
    account.



    "Tim Reynolds" <> wrote in message
    news:...
    > Using Web Service to raise Event, for Enterpise Instrumentation (EIF) to
    > write to Application Log (in event viewer). I just reimaged my pC - so
    > trying
    > to get it set up - I had it setup before using Win 2000 and don't remember
    > hitting this error. Now I'm on XP Pro, and seeing:
    > Error loading an Event Sink of type
    > 'Microsoft.ApplicationBlocks.Logging.EventSinks.LogEventSink,
    > Microsoft.ApplicationBlocks.Logging.EventSinks, Version=1.0.0.0,
    > Culture=neutral, PublicKeyToken=da59d79eb5fd8f1a'. The Event Source of
    > name
    > 'Application' will not write events out to this Event Sink. The following
    > exception was returned during the load:
    >
    > System.Reflection.TargetInvocationException: Exception has been thrown by
    > the target of an invocation. ---> System.Security.SecurityException:
    > Requested registry access is not allowed.
    > at Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable)
    > at System.Diagnostics.EventLog.FindSourceRegistration(String source,
    > String machineName, Boolean readOnly)
    > at System.Diagnostics.EventLog.SourceExists(String source, String
    > machineName)
    > at System.Diagnostics.EventLog.SourceExists(String source)
    > at
    > Microsoft.ApplicationBlocks.Logging.EventSinks.LogEventSink.CreateEventSource()
    > at
    > Microsoft.ApplicationBlocks.Logging.EventSinks.LogEventSink..ctor(IDictionary
    > parameters, EventSource eventSource)
    > --- End of inner exception stack trace ---
    >
    >
    > Please assists - Thanks.
    > I've heard I shouldn't make ASPNET ID administrator for security reasons,
    > so
    > I don't want to go that route.
    >
    > WHat can I do?
    >
    > Thanks,
    > Tim
    > Verizon
    >
    Nicole Calinoiu, May 20, 2005
    #3
    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. HK
    Replies:
    1
    Views:
    3,605
    Cowboy \(Gregory A. Beamer\)
    Apr 1, 2004
  2. Kovan A.
    Replies:
    0
    Views:
    989
    Kovan A.
    May 31, 2004
  3. Ray5531
    Replies:
    2
    Views:
    6,889
    Ray5531
    May 19, 2005
  4. Luis Esteban Valencia
    Replies:
    0
    Views:
    4,080
    Luis Esteban Valencia
    Jul 14, 2005
  5. Leyla
    Replies:
    2
    Views:
    660
    Leyla
    Aug 17, 2006
Loading...

Share This Page