Hi All
in my asp.net application I'm registering my errors in an event log.
I'm using this method to log errors:
--------
protected void LogEvent (string message, EventLogEntryType entryType)
{
if(!EventLog.SourceExists
("OnlineCommunity.com"))
{
EventLog.CreateEventSource
("OnlineCommunity.com", "Application");
}
EventLog.WriteEntry ("OnlineCommunity",
message, entryType);
}
----------
and i granted permissions to aspnet user as an admin user with full
previlages and added this line of code to the web.config file:
<identity impersonate = "true" />
i'm working on a standalone pc with localhost, I don't have a
machine.config file and when I'm trying to view the default page in
the prowser the following exception appears:
----------
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 29: if(!EventLog.SourceExists
("OnlineCommunity.com"))
Line 30: {
Line 31: EventLog.CreateEventSource
("OnlineCommunity.com", "Application");
Line 32: }
Line 33: EventLog.WriteEntry
("OnlineCommunity", message, entryType);
------------------
here is the contents of the web.config file:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<compilation
defaultLanguage="c#"
debug="true"
/>
<customErrors
mode="RemoteOnly"
/>
<identity impersonate = "true" />
<authentication mode="Forms">
<forms name="OnlineCommunity" path="/"
loginUrl="/OnlineCommunity/Modules/Users/Login.aspx"
protection="All" timeout="30">
</forms>
</authentication>
<authorization>
<allow users="*" />
</authorization>
<trace
enabled="false"
requestLimit="10"
pageOutput="false"
traceMode="SortByTime"
localOnly="true"
/>
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data
source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="20"
/>
<globalization
requestEncoding="utf-8"
responseEncoding="utf-8"
/>
</system.web>
</configuration>
----------------------------
can anyone tell me what can I do?
thanks alot
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/