Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.ConsoleClient/3.3/Program.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.ConsoleClient/3.3/Program.cs	(revision 6944)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.ConsoleClient/3.3/Program.cs	(revision 6945)
@@ -21,4 +21,5 @@
 
 using System;
+using System.Diagnostics;
 using System.Threading;
 
@@ -26,6 +27,18 @@
   public class Program {
     static void Main(string[] args) {
+      EventLog eventLog = null;
+      try {
+        if (!System.Diagnostics.EventLog.SourceExists("HLHive")) {
+          System.Diagnostics.EventLog.CreateEventSource("HLHive", "HiveSlave");
+        }
+        eventLog = new EventLog();
+        eventLog.Source = "HLHive";
+        eventLog.Log = "HiveSlave";
+      }
+      catch (Exception) { }
+
       //slave part
       Core core = new Core();
+      core.ServiceEventLog = eventLog;
       Console.WriteLine("Starting core ...");
       Thread coreThread = new Thread(core.Start);
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.TrayIcon/3.3/HeuristicLab.Clients.Hive.Slave.TrayIcon-3.3.csproj
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.TrayIcon/3.3/HeuristicLab.Clients.Hive.Slave.TrayIcon-3.3.csproj	(revision 6944)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.TrayIcon/3.3/HeuristicLab.Clients.Hive.Slave.TrayIcon-3.3.csproj	(revision 6945)
@@ -37,5 +37,5 @@
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
     <PlatformTarget>AnyCPU</PlatformTarget>
-    <OutputPath>..\..\..\..\..\trunk\sources\bin\</OutputPath>
+    <OutputPath>bin\Debug\</OutputPath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
@@ -46,21 +46,21 @@
     <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
       <HintPath>..\..\..\..\..\trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath>
-      <Private>False</Private>
+      <Private>True</Private>
     </Reference>
     <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
       <HintPath>..\..\..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>
-      <Private>False</Private>
+      <Private>True</Private>
     </Reference>
     <Reference Include="HeuristicLab.Core.Views-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
       <HintPath>..\..\..\..\..\trunk\sources\bin\HeuristicLab.Core.Views-3.3.dll</HintPath>
-      <Private>False</Private>
+      <Private>True</Private>
     </Reference>
     <Reference Include="HeuristicLab.MainForm-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
       <HintPath>..\..\..\..\..\trunk\sources\bin\HeuristicLab.MainForm-3.3.dll</HintPath>
-      <Private>False</Private>
+      <Private>True</Private>
     </Reference>
     <Reference Include="HeuristicLab.MainForm.WindowsForms-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
       <HintPath>..\..\..\..\..\trunk\sources\bin\HeuristicLab.MainForm.WindowsForms-3.3.dll</HintPath>
-      <Private>False</Private>
+      <Private>True</Private>
     </Reference>
     <Reference Include="System" />
@@ -112,10 +112,10 @@
       <Project>{8C0D9F39-397F-4DBE-856F-BC4DC0FE23F8}</Project>
       <Name>HeuristicLab.Clients.Hive.Slave.Views-3.3</Name>
-      <Private>False</Private>
+      <Private>True</Private>
     </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Clients.Hive.Slave\3.3\HeuristicLab.Clients.Hive.Slave-3.3.csproj">
       <Project>{989FE92B-484E-41EE-87E2-6A24AF0381D8}</Project>
       <Name>HeuristicLab.Clients.Hive.Slave-3.3</Name>
-      <Private>False</Private>
+      <Private>True</Private>
     </ProjectReference>
   </ItemGroup>
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Views/3.3/SlaveMainViewBase.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Views/3.3/SlaveMainViewBase.cs	(revision 6944)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Views/3.3/SlaveMainViewBase.cs	(revision 6945)
@@ -61,4 +61,5 @@
     #region Register Content Events
     protected override void DeregisterContentEvents() {
+      Content.CoreConnectionChanged -= new EventHandler<Common.EventArgs<CoreConnection>>(Content_CoreConnectionChanged);
       base.DeregisterContentEvents();
     }
@@ -66,4 +67,11 @@
     protected override void RegisterContentEvents() {
       base.RegisterContentEvents();
+      Content.CoreConnectionChanged += new EventHandler<Common.EventArgs<CoreConnection>>(Content_CoreConnectionChanged);
+    }
+
+    void Content_CoreConnectionChanged(object sender, Common.EventArgs<CoreConnection> e) {
+      if (e.Value == CoreConnection.Offline) {
+        Connector();
+      }
     }
     #endregion
@@ -77,4 +85,6 @@
         Content.UserVisibleMessageFired += new System.EventHandler<Common.EventArgs<string>>(Content_UserVisibleMessageFired);
         Task.Factory.StartNew(Connector);
+      } else {
+        Content.UserVisibleMessageFired -= new System.EventHandler<Common.EventArgs<string>>(Content_UserVisibleMessageFired);
       }
     }
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.WindowsService/3.3/ProjectInstaller.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.WindowsService/3.3/ProjectInstaller.cs	(revision 6944)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.WindowsService/3.3/ProjectInstaller.cs	(revision 6945)
@@ -15,4 +15,12 @@
       base.OnAfterInstall(savedState);
 
+      //try to create an event log      
+      try {
+        if (!System.Diagnostics.EventLog.SourceExists("HLHive")) {
+          System.Diagnostics.EventLog.CreateEventSource("HLHive", "HiveSlave");
+        }
+      }
+      catch { }
+
       //try to start the service after installation
       using (var serviceController = new ServiceController(this.serviceInstaller1.ServiceName, Environment.MachineName)) {
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.3/Core.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.3/Core.cs	(revision 6944)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.3/Core.cs	(revision 6945)
@@ -71,4 +71,5 @@
     public void Start() {
       abortRequested = false;
+      EventLogManager.ServiceEventLog = ServiceEventLog;
 
       try {
@@ -90,8 +91,5 @@
       catch (Exception ex) {
         if (ServiceEventLog != null) {
-          try {
-            ServiceEventLog.WriteEntry(string.Format("Hive Slave threw exception: {0} with stack trace: {1}", ex.ToString(), ex.StackTrace), EventLogEntryType.Error);
-          }
-          catch (Exception) { }
+          EventLogManager.LogException(ex);
         } else {
           //try to log with clientCom. if this works the user sees at least a message, 
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.3/HeuristicLab.Clients.Hive.Slave-3.3.csproj
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.3/HeuristicLab.Clients.Hive.Slave-3.3.csproj	(revision 6944)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.3/HeuristicLab.Clients.Hive.Slave-3.3.csproj	(revision 6945)
@@ -118,4 +118,5 @@
     <Compile Include="ExecutorQueue.cs" />
     <Compile Include="IPluginProvider.cs" />
+    <Compile Include="Manager\EventLogManager.cs" />
     <Compile Include="Manager\TaskManager.cs" />
     <Compile Include="Exceptions\OutOfCoresException.cs" />
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.3/Manager/EventLogManager.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.3/Manager/EventLogManager.cs	(revision 6945)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.3/Manager/EventLogManager.cs	(revision 6945)
@@ -0,0 +1,46 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Diagnostics;
+namespace HeuristicLab.Clients.Hive.SlaveCore {
+  public static class EventLogManager {
+    public static EventLog ServiceEventLog { get; set; }
+
+    public static void LogMessage(string message) {
+      if (ServiceEventLog != null) {
+        try {
+          ServiceEventLog.WriteEntry(string.Format("Hive Slave: {0} ", message), EventLogEntryType.Error);
+        }
+        catch { }
+      }
+    }
+
+    public static void LogException(Exception ex) {
+      if (ServiceEventLog != null) {
+        try {
+          ServiceEventLog.WriteEntry(string.Format("Hive Slave threw exception: {0} with stack trace: {1}", ex.ToString(), ex.StackTrace), EventLogEntryType.Error);
+        }
+        catch { }
+      }
+    }
+  }
+}
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.3/SlaveClientCom.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.3/SlaveClientCom.cs	(revision 6944)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.3/SlaveClientCom.cs	(revision 6945)
@@ -57,6 +57,15 @@
       }
       catch {
-        pipeFactory = new DuplexChannelFactory<ISlaveCommunication>(dummy, new NetNamedPipeBinding(), new EndpointAddress("net.pipe://localhost/HeuristicLabSlaveCom"));
+        EventLogManager.LogMessage("Couldn't create pipe for SlaveClientCom with config!");
+
+        try {
+          pipeFactory = new DuplexChannelFactory<ISlaveCommunication>(dummy, new NetNamedPipeBinding(), new EndpointAddress("net.pipe://localhost/HeuristicLabSlaveCom"));
+        }
+        catch {
+          EventLogManager.LogMessage("Couldn't create pipe for SlaveClientCom with fixed addresse!");
+          return;
+        }
       }
+      pipeFactory.Faulted += new System.EventHandler(pipeFactory_Faulted);
 
       ISlaveCommunication pipeProxy = pipeFactory.CreateChannel();
@@ -64,6 +73,16 @@
     }
 
+    void pipeFactory_Faulted(object sender, System.EventArgs e) {
+      EventLogManager.LogMessage("SlaveClientCom just faulted. Trying to repair it...");
+
+      try {
+        pipeFactory.Faulted -= new System.EventHandler(pipeFactory_Faulted);
+        SetupClientCom();
+      }
+      catch { }
+    }
+
     public static void Close() {
-      if (pipeFactory.State != CommunicationState.Closed)
+      if (pipeFactory.State != CommunicationState.Closed && pipeFactory.State != CommunicationState.Faulted)
         pipeFactory.Close();
     }
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.3/SlaveCommunicationService.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.3/SlaveCommunicationService.cs	(revision 6944)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.3/SlaveCommunicationService.cs	(revision 6945)
@@ -20,4 +20,5 @@
 #endregion
 
+using System;
 using System.Collections.Generic;
 using System.ServiceModel;
@@ -54,21 +55,31 @@
 
     public void LogMessage(string message) {
-      subscribers.ForEach(delegate(ISlaveCommunicationCallbacks callback) {
-        if (((ICommunicationObject)callback).State == CommunicationState.Opened) {
-          callback.OnMessageLogged(message);
-        } else {
-          subscribers.Remove(callback);
-        }
-      });
+      try {
+        subscribers.ForEach(delegate(ISlaveCommunicationCallbacks callback) {
+          if (((ICommunicationObject)callback).State == CommunicationState.Opened) {
+            callback.OnMessageLogged(message);
+          } else {
+            subscribers.Remove(callback);
+          }
+        });
+      }
+      catch (Exception ex) {
+        EventLogManager.LogException(ex);
+      }
     }
 
     public void StatusChanged(StatusCommons status) {
-      subscribers.ForEach(delegate(ISlaveCommunicationCallbacks callback) {
-        if (((ICommunicationObject)callback).State == CommunicationState.Opened) {
-          callback.OnStatusChanged(status);
-        } else {
-          subscribers.Remove(callback);
-        }
-      });
+      try {
+        subscribers.ForEach(delegate(ISlaveCommunicationCallbacks callback) {
+          if (((ICommunicationObject)callback).State == CommunicationState.Opened) {
+            callback.OnStatusChanged(status);
+          } else {
+            subscribers.Remove(callback);
+          }
+        });
+      }
+      catch (Exception ex) {
+        EventLogManager.LogException(ex);
+      }
     }
 
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.3/SlaveTask.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.3/SlaveTask.cs	(revision 6944)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.3/SlaveTask.cs	(revision 6945)
@@ -51,5 +51,13 @@
 
     public TimeSpan ExecutionTime {
-      get { return executor != null ? executor.ExecutionTime : TimeSpan.Zero; }
+      get {
+        try {
+          return executor != null ? executor.ExecutionTime : TimeSpan.Zero;
+        }
+        catch (Exception ex) {
+          EventLogManager.LogException(ex);
+          return TimeSpan.Zero;
+        }
+      }
     }
 
@@ -122,5 +130,10 @@
 
       if (executor != null) {
-        executor.Dispose();
+        try {
+          executor.Dispose();
+        }
+        catch (Exception ex) {
+          EventLogManager.LogException(ex);
+        }
       }
 
@@ -155,5 +168,12 @@
 
     public TaskData GetTaskData() {
-      return executor.GetTaskData();
+      TaskData data = null;
+      try {
+        data = executor.GetTaskData();
+      }
+      catch (Exception ex) {
+        EventLogManager.LogException(ex);
+      }
+      return data;
     }
 
