Index: /trunk/sources/HeuristicLab.Hive.Client.Communication/ServiceLocator.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Client.Communication/ServiceLocator.cs	(revision 881)
+++ /trunk/sources/HeuristicLab.Hive.Client.Communication/ServiceLocator.cs	(revision 882)
@@ -13,5 +13,5 @@
         proxy = new ClientCommunicatorClient(
           new NetTcpBinding(),
-          new EndpointAddress("net.tcp://10.20.53.3:9000/HiveServer/ClientCommunicator")
+          new EndpointAddress("net.tcp://192.168.132.1:9000/HiveServer/ClientCommunicator")
           );
       }
Index: /trunk/sources/HeuristicLab.Hive.Client.Core/Core.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Client.Core/Core.cs	(revision 881)
+++ /trunk/sources/HeuristicLab.Hive.Client.Core/Core.cs	(revision 882)
@@ -50,26 +50,8 @@
     Dictionary<long, AppDomain> appDomains = new Dictionary<long, AppDomain>();
 
-    public static StrongName CreateStrongName(Assembly assembly) {
-      if (assembly == null)
-        throw new ArgumentNullException("assembly");
-
-      AssemblyName assemblyName = assembly.GetName();
-      Debug.Assert(assemblyName != null, "Could not get assembly name");
-
-      // get the public key blob
-      byte[] publicKey = assemblyName.GetPublicKey();
-      if (publicKey == null || publicKey.Length == 0)
-        throw new InvalidOperationException("Assembly is not strongly named");
-
-      StrongNamePublicKeyBlob keyBlob = new StrongNamePublicKeyBlob(publicKey);
-
-      // and create the StrongName
-      return new StrongName(keyBlob, assemblyName.Name, assemblyName.Version);
-    }
-
     private ClientCommunicatorClient clientCommunicator;
 
     public void Start() {
-       DiscoveryService discService =
+       /*DiscoveryService discService =
         new DiscoveryService();
       IClientConsoleCommunicator[] clientCommunicatorInstances =
@@ -99,5 +81,5 @@
 
         serviceHost.Open();
-      }
+      }*/
 
       clientCommunicator = ServiceLocator.GetClientCommunicator();
@@ -105,5 +87,5 @@
       clientCommunicator.PullJobCompleted += new EventHandler<PullJobCompletedEventArgs>(ClientCommunicator_PullJobCompleted);
       clientCommunicator.SendJobResultCompleted += new EventHandler<SendJobResultCompletedEventArgs>(ClientCommunicator_SendJobResultCompleted);
-      clientCommunicator.LoginAsync(ConfigurationManager.GetInstance().GetClientInfo());
+      //clientCommunicator.LoginAsync(ConfigurationManager.GetInstance().GetClientInfo());
 
       Heartbeat beat = new Heartbeat { Interval = 5000 };
@@ -127,20 +109,4 @@
       } else
         Logging.GetInstance().Error(this.ToString(), e.Result.StatusMessage);
-    }
-
-    private AppDomain CreateNewAppDomain(bool sandboxed) {
-      PermissionSet pset;
-      if (sandboxed) {
-        pset = new PermissionSet(PermissionState.None);
-        pset.AddPermission(new SecurityPermission(SecurityPermissionFlag.Execution));
-      } else {
-        pset = new PermissionSet(PermissionState.Unrestricted);
-      }
-      AppDomainSetup setup = new AppDomainSetup();
-      setup.ApplicationBase = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
-      //Temp Fix!
-      setup.PrivateBinPath = "plugins";
-      return System.AppDomain.CreateDomain("appD", AppDomain.CurrentDomain.Evidence, setup, pset, CreateStrongName(Assembly.GetExecutingAssembly()));
-
     }
 
@@ -188,10 +154,6 @@
       bool sandboxed = false;
 
-      //IJob job = new TestJob { JobId = e.Result.JobId };
-
-      PluginManager pm = PluginManager.Manager;
-      AppDomain appDomain =  pm.CreateAndInitAppDomain("AppDomain");
-
-      //AppDomain appDomain = CreateNewAppDomain(sandboxed);
+      AppDomain appDomain =  PluginManager.Manager.CreateAndInitAppDomainWithSandbox(e.Result.JobId.ToString(), sandboxed);
+      
       appDomains.Add(e.Result.JobId, appDomain);
 
Index: /trunk/sources/HeuristicLab.Hive.Client.Core/Properties/AssemblyInfo.frame
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Client.Core/Properties/AssemblyInfo.frame	(revision 881)
+++ /trunk/sources/HeuristicLab.Hive.Client.Core/Properties/AssemblyInfo.frame	(revision 882)
@@ -23,4 +23,5 @@
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
+using System.Security;
 using HeuristicLab.PluginInfrastructure;
 
@@ -36,4 +37,5 @@
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
+[assembly: AllowPartiallyTrustedCallers]
 
 // Setting ComVisible to false makes the types in this assembly not visible 
Index: /trunk/sources/HeuristicLab.PluginInfrastructure/PluginManager.cs
===================================================================
--- /trunk/sources/HeuristicLab.PluginInfrastructure/PluginManager.cs	(revision 881)
+++ /trunk/sources/HeuristicLab.PluginInfrastructure/PluginManager.cs	(revision 882)
@@ -22,4 +22,9 @@
 using System;
 using System.Collections.Generic;
+using System.Security.Policy;
+using System.Reflection;
+using System.Diagnostics;
+using System.Security.Permissions;
+using System.Security;
 
 namespace HeuristicLab.PluginInfrastructure {
@@ -132,4 +137,51 @@
     }
 
+    /// <summary>
+    /// Creates a new AppDomain with all plugins preloaded and Sandboxing capability
+    /// </summary>
+    /// <param name="assembly">Assembly reference</param>
+    /// <returns>the strongname of the assembly</returns>
+    private StrongName CreateStrongName(Assembly assembly) {
+      if (assembly == null)
+        throw new ArgumentNullException("assembly");
+
+      AssemblyName assemblyName = assembly.GetName();
+      Debug.Assert(assemblyName != null, "Could not get assembly name");
+
+      // get the public key blob
+      byte[] publicKey = assemblyName.GetPublicKey();
+      if (publicKey == null || publicKey.Length == 0)
+        throw new InvalidOperationException("Assembly is not strongly named");
+
+      StrongNamePublicKeyBlob keyBlob = new StrongNamePublicKeyBlob(publicKey);
+
+      // and create the StrongName
+      return new StrongName(keyBlob, assemblyName.Name, assemblyName.Version);
+    }
+
+    public AppDomain CreateAndInitAppDomainWithSandbox(string friendlyName, bool sandboxed) {
+
+      PermissionSet pset;
+      if (sandboxed) {
+        pset = new PermissionSet(PermissionState.None);
+        pset.AddPermission(new SecurityPermission(SecurityPermissionFlag.Execution));        
+      } else {
+        pset = new PermissionSet(PermissionState.Unrestricted);
+      }
+      AppDomainSetup setup = AppDomain.CurrentDomain.SetupInformation;
+      setup.PrivateBinPath = pluginDir;
+      setup.ApplicationBase = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;      
+      AppDomain applicationDomain = AppDomain.CreateDomain(friendlyName, AppDomain.CurrentDomain.Evidence, setup, pset, CreateStrongName(Assembly.GetExecutingAssembly()));
+                      
+      Runner remoteRunner = (Runner)applicationDomain.CreateInstanceAndUnwrap(typeof(Runner).Assembly.GetName().Name, typeof(Runner).FullName);
+      NotifyListeners(PluginManagerAction.Initializing, "All plugins");
+      if (remoteLoader != null) {
+        remoteRunner.LoadPlugins(remoteLoader.ActivePlugins);
+      } else if (LoadedPlugins != null && LoadedPlugins.Count > 0) {
+        remoteRunner.LoadPlugins(LoadedPlugins);
+      }
+      NotifyListeners(PluginManagerAction.Initialized, "All plugins");
+      return applicationDomain;
+    }
 
     /// <summary>
