This is a frequently asked question that is covered in the index.htm file in the code download.
The problem is that the ASPNET user account doesn't have permission to create an event source (this is the way Microsoft designed it). There are 3 possible solutions given in the index.htm file, but I don't care for any of them.
My personal favorite fix is to have you create the event source yourself by running a console mode program (this runs with your personal rights, and you are probably an administrator, so this should work).
Compile this C# code as a console application and run it (it doesn't matter if you are mostly a
VB.NET coder - this is just a trivial program that will create your event source):
using System;
using System.Diagnostics;
using System.Threading;
class MySample
{
public static void Main()
{
// Create the source, if it does not already exist.
if (EventLog.SourceExists("ThePhile.COM"))
{
Console.WriteLine("Source already exists");
}
else
{
Console.WriteLine("Creating Event Source");
EventLog.CreateEventSource("ThePhile.COM", "Application");
}
// Create an EventLog instance and assign its source.
EventLog myLog = new EventLog();
myLog.Source = "ThePhile.COM";
// Write an entry to the event log as a test.
myLog.WriteEntry("ThePhile test message");
Console.Write("Message written to eventlog. Press Enter...");
Console.ReadLine();
}
}
Then look in the Windows event log for the test message. Your web app should be able to write to this same event source.
Eric