Security Exception when writting to EventLog

Discussion in 'ASP .Net Web Services' started by JMMB, May 19, 2005.

  1. JMMB

    JMMB Guest

    When trying to execute the following code in a web service, I get the
    enclosed error. Everyone has full control do the registry and Security System
    configured with the default "Full Control" for all code.
    thanks a lot.

    WEBMETHOD:
    EventLog log = new EventLog("ContosoLog");
    log.Source = "MyServiceApplication";
    log.WriteEntry("My sessionID", EventLogEntryType.Warning);

    ERROR:
    System.Web.Services.Protocols.SoapException: Server was unable to process
    request. ---> 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.WriteEntry(String message, EventLogEntryType
    type, Int32 eventID, Int16 category, Byte[] rawData) at
    System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType
    type, Int32 eventID, Int16 category) at
    System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType
    type, Int32 eventID) at System.Diagnostics.EventLog.WriteEntry(String
    message, EventLogEntryType type) at MyService.Service1.SessionID() in
    c:\inetpub\wwwroot\myservice\service1.asmx.cs:line 79 --- End of inner
    exception stack trace ---
     
    JMMB, May 19, 2005
    #1
    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. Hai Nguyen
    Replies:
    0
    Views:
    1,959
    Hai Nguyen
    Feb 26, 2004
  2. John Carnahan

    Multi-Line TextBox writting to Sql Server

    John Carnahan, May 27, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    8,632
    John Carnahan
    May 28, 2004
  3. José Joye
    Replies:
    5
    Views:
    462
    José Joye
    May 31, 2004
  4. Adrian Parker

    Writting RegularExpressionValidator for time?

    Adrian Parker, Sep 27, 2004, in forum: ASP .Net
    Replies:
    6
    Views:
    4,428
    Adrian Parker
    Sep 27, 2004
  5. JMMB

    Security problem when writting to Event Log

    JMMB, May 19, 2005, in forum: ASP .Net Security
    Replies:
    3
    Views:
    676
    Nicole Calinoiu
    May 19, 2005
Loading...

Share This Page