views:

32

answers:

0

I have created a service plan to run on Windows server 2008. When I test the service in my Windows XP, the event log category can be created properly. However, It doesn't work on server 2008. I run the service as administrator account already.

    private EventLog __eventLog;
    if (!EventLog.SourceExists("MyEventLogCat"))
        EventLog.CreateEventSource("MyEventLogCat", "MyEventLogCat");
    __eventLog = new EventLog();
    __eventLog.Source = "MyEventLogCat";
    __eventLog.Log = "MyEventLogCat";

Thanks.