473,804 Members | 3,742 Online
Bytes | Software Development & Data Engineering Community
+ 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 1586
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 EventLogInstall er 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 EventLogInstall er 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_s ecurity.asp

#Security Descriptor Definition Language
http://msdn.microsoft.com/library/de...us/secauthz/se
curity/security_descri ptor_string_for mat.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
19188
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 Event log. My environment: Windows Server 2003, IIS 6, WSH, Classic ASP, Vbscript Below is the code and the error: Code:
2
329
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 a Key called "TEST" under the Application in the Registry based on the microsoft article 329291 and using Solution 1 in that article In the code I basically do the following Dim MyLog as new EventLog( MyLog.Source = "TEST
2
4071
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 error "This file is being used by another process". Both the applications are in C#. P.S. Even if I try to open the file with NotePad (while my server is writing data in the file)it gives the same error.
7
2863
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 custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
9
3218
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 questions are below... "David Good" wrote: > We have a network running both Win2k and Win2k3 webservers and our web sites > reside on a UNC network share that happens to be a Network Appliance NAS.
0
2268
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 updating the code-behind dll) accessing any aspx page in the application causes the application to run for the first time. Some of the initialization involves reading and writing some text and xml files using simple streamreader and streamwriter...
3
7026
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 redirect the user to a new page with the file that was just created. Code: Dim objFSO, objTextFile Dim sRead, sReadLine, sReadAll Const ForReading = 1, ForWriting = 2, ForAppending = 8
9
2104
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 app through code? I am using End for now. Is there a way I can suppress this exception message? The app gets invoked programmatically on a schedule. So no one would be around to click off the
5
1343
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 interet but time is of the essence and I prefer supported software. Thanks. -- Mark
0
3604
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 Page_error has code: Throw Server.GetLastError
0
9704
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9571
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10561
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10318
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10302
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9132
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5505
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2976
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.