eventLog.WriteEntry(message, EventLogEntryType.Information);
Assert.True(signal.WaitOne(6000));
}
+ // The system responds to WriteEntry only if the last write event occurred at least six seconds previously.
+ // This implies that the system will only receive one EntryWritten event notification within a six-second interval, even if more than one event log change occurs.
+ // For more information https://msdn.microsoft.com/en-us/library/system.diagnostics.eventlog.entrywritten(v=vs.110).aspx
}
}
}
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-
using System.ComponentModel;
using Xunit;
eventLog.WriteEntry(message);
}
-
if (eventLog.Entries.Count == 0)
return null;
{
internal class Helpers
{
- public static bool IsElevatedAndSupportsEventLogs { get => AdminHelpers.IsProcessElevated() && PlatformDetection.IsNotWindowsNanoServer; }
+ public static bool IsElevatedAndSupportsEventLogs { get => AdminHelpers.IsProcessElevated() && SupportsEventLogs; }
public static bool SupportsEventLogs { get => PlatformDetection.IsNotWindowsNanoServer; }
}
}