writing to the log file problem

Nov 1 2003 3:23 PM
I'm reading a book that has the script below, the purpose of the script is to write to the log but I'm having security problems, here's the script: <%@Page Language="C#"%> <%@ Import Namespace="System.Diagnostics" %> <% EntryToLog(); %> Here's the error I'm receiving: Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. Exception Details: System.Security.SecurityException: Requested registry access is not allowed. Source Error: Line 17: string LogName = "MyApplicationLog"; Line 18: string SourceName = "MyApplicationSource"; Line 19: if (!(EventLog.SourceExists(SourceName))) //the error highlights this line Line 20: { Line 21: EventLog.CreateEventSource(SourceName, LogName); The book doesn't say anything about setting any security settings before running the example, so I have no idea what to do. Could some kind hearted soul give me a good clear explanation of how to resolve this issue. Thanks a confused learner.