Windows Server 2003で適切に機能する次のコードがあります。これは、EventViewerのアプリケーションイベントログに書き込みます。同じコードはWindows2008では機能しません。アプリケーションがクラッシュします。WindowsServer2008のイベントログへの書き込み方法についてサポートを依頼してください。
if (!EventLog.SourceExists("MyServiceLog"))
{
EventLog.CreateEventSource("MyServiceLog", "Application");
}
//Create an EventLog instance and assign its source.
EventLog eventLog = new EventLog();
eventLog.Source = "MyServiceLog";
//Write an informational entry to the event log.
eventLog.WriteEntry(Header + ": " + FailureReason);