472,378 Members | 1,443 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,378 software developers and data experts.

Create New EventLog

Hi NG
I try to create a new EventSource in an asp.net projetct with the following
code but I always get the error
Registry access nod allowed...
I changed the userName in the processModell of my machine.config file to
SYSTEM.
What else do I have to do?
try
{
if (!System.Diagnostics.EventLog.SourceExists(applica tionName))
{
System.Diagnostics.EventLog.CreateEventSource(appl icationName, "ESHOP");
}
}
catch(System.Security.SecurityException e)
{
throw new System.Security.SecurityException(e.Message);
}

tnx

stefan
Nov 15 '05 #1
1 4543
Stefan, You can do a couple of things,

1. Change the access that the aspnet user has on your web server so that it
is allowed access to the event log.
2. Change the user under which ASP.Net runs.
3. Use impersonation for that section of code to impersonate a privileged
use while running within the ASP.Net process.

--
Greg Ewing [MVP]
http://www.claritycon.com/
"Stefan" <sh****@steffsworld.ch> wrote in message
news:O5**************@tk2msftngp13.phx.gbl...
Hi NG
I try to create a new EventSource in an asp.net projetct with the following code but I always get the error
Registry access nod allowed...
I changed the userName in the processModell of my machine.config file to
SYSTEM.
What else do I have to do?
try
{
if (!System.Diagnostics.EventLog.SourceExists(applica tionName))
{
System.Diagnostics.EventLog.CreateEventSource(appl icationName, "ESHOP");
}
}
catch(System.Security.SecurityException e)
{
throw new System.Security.SecurityException(e.Message);
}

tnx

stefan

Nov 15 '05 #2

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

Similar topics

1
by: Joe | last post by:
I am trying to read the EventLog of different servers on the network. If I run the script in a command line, it works well. But when I try to put the script into the Web server (IIS in Windows...
1
by: José Joye | last post by:
I know, this kind of question has already been asked. However, I could not find an answer related to the minimal privilege required to be able to create a new event Source in the appplication event...
0
by: Jacob Colding | last post by:
Hello, I have created a a logging mechanism, that writes mesages to a custom event log. On each check it verifies whether the requested source is registered to the "IPS" log. If not, it changes...
1
by: MAL | last post by:
Hello, I am writing a service program that writes to a custom EventLog. I would like the two classes used in the service to write messages to the same log ideally using a different Source name...
17
by: Chris Podmore | last post by:
When I perform: EventLog.WriteEntry(strSource, strEntry, EventLogEntryType.Error, intEventID) The event viewer reports The description for Event ID ( 234 ) in Source ( Siclops_WS_Mobile )...
6
by: Philip Wagenaar | last post by:
What is the best way to create a local user on the machine with administrator rights? I have problems with my code on machines that have password policy. The problem is that when the user is...
1
by: martin | last post by:
Hi, I'm having some problems with the System.Diagnostics.EventLog class in .NET 2.0 I need to recreate an event message source inside a new log but the messages keeps ending up in the old...
3
by: Ben | last post by:
I am trying to write an eventlog monitor. I am using the sample code provided by VB2005 SDK as the bases for my application. I need to monitor all three logs (application, system, and security)....
1
by: Jeff | last post by:
hi ..Net 2.0 I've created the code below and think I've executed it. After I thought I've executed it I checked in EventLog on the computer (win2k3) and no entry was added. This could mean 2...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

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.