473,472 Members | 1,728 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Error writing to application lo from web app

Using VS 2005 on Windows XP with SP2, I am attempting to write to the
application log.

I receive a dialog box that says: "Addiyional information: Ther source was
not found, but some or all event logs could not be searched. Inaccessible
logs: Security."
How should I correct this error?

Thanks,

Leslie

Jul 17 '06 #1
4 1574
Hi Leslie,

Thank you for your post.

Based on my understanding and experience, the exception is because you're
attempting to create an event source that doesn't exist, and the account
that you're using to create the source (implicitly through your attempt to
write an entry) doesn't have access to all registry keys required for the
source to be created. For ASP.NET Web Application, this normally means
ASP.NET worker process account doesn't have the access to write to registry
key to create the event log source.

You can refer to following KB for more information:

#PRB: "Requested Registry Access Is Not Allowed" Error Message When ASP.NET
Application Tries to Write New EventSource in the EventLog
http://support.microsoft.com/kb/329291

This KB introduces two resolutions to this issue:
1) Manually create the event log source in registry
2) Use EventLogInstaller class to create the event log with InstallUtil.

Hope this helps. Please feel free to post here if anything is unclear.

Sincerely,
Walter Wang
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 18 '06 #2
The account running the aspnet application (aspnet) does not have the
needed permissions to write to the event log. Here's the first thing I
found in a quick search to get you started in resolving the issue.

http://objectsharp.com/blogs/bruce/a...11/03/180.aspx

Jul 18 '06 #3
Walter,

Thanks, that worked great.

However, now I get an error that says, "Cannot open log for source 'SRP'.
You may not have write access."

This is occurring on a Win XP SP2 development machine.
I am running the web with impersonation on so I think that means I am using
local IUSR account.

Any ideas?

"Walter Wang [MSFT]" wrote:
Hi Leslie,

Thank you for your post.

Based on my understanding and experience, the exception is because you're
attempting to create an event source that doesn't exist, and the account
that you're using to create the source (implicitly through your attempt to
write an entry) doesn't have access to all registry keys required for the
source to be created. For ASP.NET Web Application, this normally means
ASP.NET worker process account doesn't have the access to write to registry
key to create the event log source.

You can refer to following KB for more information:

#PRB: "Requested Registry Access Is Not Allowed" Error Message When ASP.NET
Application Tries to Write New EventSource in the EventLog
http://support.microsoft.com/kb/329291

This KB introduces two resolutions to this issue:
1) Manually create the event log source in registry
2) Use EventLogInstaller class to create the event log with InstallUtil.

Hope this helps. Please feel free to post here if anything is unclear.

Sincerely,
Walter Wang
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 18 '06 #4
Hi Leslie,

Thank you for your quick reply.

Based on my understanding, you're impersonating fixed identity (the
IUSR_xxx account) to run your asp.net website. This account has very
limited privilege and by default cannot write to event log. You can refer
to following MSDN Library article:

#Event Logging Security
http://msdn.microsoft.com/library/de...us/eventlog/ba
se/event_logging_security.asp

#Security Descriptor Definition Language
http://msdn.microsoft.com/library/de...us/secauthz/se
curity/security_descriptor_string_format.asp

While modifying CustomSD registry key of the application event log can
enable this account to write to event log, it's not recommended. The
recommended way is to only impersonate when required, for example when you
need to access a network resource or connect to a database. By default the
ASP.NET worker process acount will be able to write to the application
event log.

For more information on ASP.NET impersonation, please refer to following
MSDN Library article:

#How To: Use Impersonation and Delegation in ASP.NET 2.0
http://msdn.microsoft.com/library/de...us/dnpag2/html
/paght000023.asp

Hope this helps. Please feel free to post here if anything is unclear.
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 18 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Yitzhak | last post by:
I am having "Permission denied" error while calling LogEvent method of WScript.Shell component. Basically, ASP page calls Windows Script Host Shell component to log events to the OS Application...
2
by: Paul P | last post by:
I am having a problem writing errors to the application log on a Windows 2003 server running IIS 6 The error message is "InvalidOperationException: Cannot open log for source {0}." I have created...
2
by: GB | last post by:
Hi Everybody! I have 2 different processes/application. One is writing to a file and another is reading from it. For some reason the code doesnt seems to work and gives mscorlib.dll IOException...
7
by: Yongsub Eric Shin | last post by:
Hi. I'm just a beginner in ASP.Net. I started writing codes and I keep on getting this Runtime Error page, where it says "Description: An application error occurred on the server. The current...
9
by: Tim D | last post by:
Hi, I originally posted this as a reply to a rather old thread in dotnet.framework.general and didn't get any response. I thought it might be more relevant here; anyone got any ideas? My...
0
by: Joergen Bech | last post by:
Fairly new to ASP.NET 1.1. Getting the error below when running application on a web server outside of my control, but only the first time I run it: 1. After a long period of inactivity (or...
3
by: Jennifer | last post by:
On an ASP page I've got some code that is supposed to "export" data in a grid to an Excel file. What I'm doing is writing all the data to a text file, separating the fields by commas. Then I'll...
9
by: Ron | last post by:
my application is throwing an exception error when closing if I run a procedure in the app. I can't even trap the error with try/catch ex As Exception. Is there a way to completely shut down the...
5
by: Mark Jerde | last post by:
Can someone recommend a commercial error handling package I can add to my C# programs? (VS .NET 2003.) I'm not finding any googling. I know I could write my own or adapt something off the...
0
by: David Lozzi | last post by:
Howdy, I'm working on some error handling for my application. Currently on WinXP Pro SP2. Basically this is what I'm doing: Try...Catch at the method level, Catch sends email with error ...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.