C
craig.wagner
I've done a ton of searching on this error and have not found any
solution that actually solves the problem.
My environment is Windows XP Professional with SP2. I'm using VS.NET
2003 and .NET Framework v1.1.
I created a brand new ASP.NET application to ensure that some other
aspect of my real app wasn't causing the problem. I put a button on the
form and added the following lines of code.
System.Diagnostics.EventLog log =
new System.Diagnostics.EventLog( "Application", ".", "aaa" );
log.WriteEntry( "hello" );
That resulted in the "Requested registry access is not allowed"
exception being thrown.
Did some searching and found this article.
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q329291
Decide to use "First Approach" and go into registry to add new registry
key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\aaa
Run the app again, now it logs correctly.
Go into web.config and add:
<identity impersonate="true" />
This should result in the application running under the identity of the
IUSR account, because that is the account that anonymous access is
configured to use.
Now I'm getting.
InvalidOperationException: Cannot open log for source {0}. You may not
have write access.
I tried adding the IUSR account to the Administrators group. Same
error.
Just for kicks, I configured the anonymous user as the local-machine
Administrator account. Everything worked.
I created a new account called blah. Put it in the Guests group and
made it the anonymous use. Everything worked.
Switched back to the IUSR account for the anonymous user. Failed.
What is it about the IUSR account that it won't work? Why would another
account that appears to be identically configured work?
solution that actually solves the problem.
My environment is Windows XP Professional with SP2. I'm using VS.NET
2003 and .NET Framework v1.1.
I created a brand new ASP.NET application to ensure that some other
aspect of my real app wasn't causing the problem. I put a button on the
form and added the following lines of code.
System.Diagnostics.EventLog log =
new System.Diagnostics.EventLog( "Application", ".", "aaa" );
log.WriteEntry( "hello" );
That resulted in the "Requested registry access is not allowed"
exception being thrown.
Did some searching and found this article.
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q329291
Decide to use "First Approach" and go into registry to add new registry
key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\aaa
Run the app again, now it logs correctly.
Go into web.config and add:
<identity impersonate="true" />
This should result in the application running under the identity of the
IUSR account, because that is the account that anonymous access is
configured to use.
Now I'm getting.
InvalidOperationException: Cannot open log for source {0}. You may not
have write access.
I tried adding the IUSR account to the Administrators group. Same
error.
Just for kicks, I configured the anonymous user as the local-machine
Administrator account. Everything worked.
I created a new account called blah. Put it in the Guests group and
made it the anonymous use. Everything worked.
Switched back to the IUSR account for the anonymous user. Failed.
What is it about the IUSR account that it won't work? Why would another
account that appears to be identically configured work?