Skip to content
Permalink
Browse files
NOJIRA attempting to fix the .net build on buildbot again
  • Loading branch information
spyhunter99 committed Aug 25, 2018
1 parent bff7be4 commit 29e192609b4f49359c5a709c2499895532a0981e
Showing 2 changed files with 20 additions and 3 deletions.
@@ -50,9 +50,19 @@ public void setName(string name)
/// </summary>
public static void RegisterLogSources()
{
if (!System.Diagnostics.EventLog.SourceExists(EVENT_LOG_SOURCE))
Boolean isRegistered = false;
try {
isRegistered = System.Diagnostics.EventLog.SourceExists(EVENT_LOG_SOURCE);
} catch { }
if (!isRegistered)
{
EventLog.CreateEventSource(EVENT_LOG_SOURCE, EVENT_LOG_SOURCE);
try
{
EventLog.CreateEventSource(EVENT_LOG_SOURCE, EVENT_LOG_SOURCE);
}catch (Exception ex)
{
throw ex;
}
}


@@ -27,7 +27,14 @@ class Program
{
static void Main(string[] args)
{
EventLogger.RegisterLogSources();
try
{
EventLogger.RegisterLogSources();
}
catch (Exception ex)
{
Console.WriteLine("Unable to register event log source. Did you run this tool as administrator? " + ex.Message);
}
}
}
}

0 comments on commit 29e1926

Please sign in to comment.