"Requested Registry Access Is Not Allowed" Error Message When ASP.NET Applicatio

From: Paul Lyons (paul@the-lyons.removethis.com)
Date: 01/30/03


From: "Paul Lyons" <paul@the-lyons.removethis.com>
Date: Thu, 30 Jan 2003 08:37:38 -0800


Hi Geir,

I got around this problem by using a different approach,
that doen't involve the installer:

using System.Diagnostics;
public void ensureEventLog(string Source)
{
  if(!EventLog.SourceExists("myLogName", "."))
  {
    EventLog.CreateEventSource(Source, "myLogName", ".");
  }

  ntLog = new EventLog("myLogName", ".", Source);
}

Hope this does what you need
Paul

>-----Original Message-----
>I need to use the EventLog classes from my ASP.NET web
>service and ran into the problem of this problem.
>
>The knowledge based article 329291 pointed me in a right
>direction
>http://support.microsoft.com/default.aspx?scid=kb;EN-
>US;Q329291
>
>BUT
>I need to create new Event Sources programmtically from
>within my web service.
>
>The article only works for predefined Event Sources
>
>Any tips on how security settings can be manipulated ?
>
>Geir
>.
>