Assembly LoadContextAssembly(RunAssemblyTask task) { if (!File.Exists(task.AssemblyLocation)) { Server.TaskException(task, new[] { new TaskException("no type", String.Format("Could not load assembly from {0}: File does not exist", task.AssemblyLocation), null) }); return(null); } AssemblyName assemblyName; try { assemblyName = AssemblyName.GetAssemblyName(task.AssemblyLocation); } catch (FileLoadException ex) { Server.TaskException(task, new[] { new TaskException("no type", String.Format("Could not load assembly from {0}: {1}", task.AssemblyLocation, ex.Message), null) }); return(null); } if (assemblyName == null) { Server.TaskException(task, new[] { new TaskException("no type", String.Format("Could not load assembly from {0}: Not an assembly", task.AssemblyLocation), null) }); return(null); } try { return(Assembly.Load(assemblyName)); } catch (Exception ex) { Server.TaskException(task, new[] { new TaskException("no type", String.Format("Could not load assembly from {0}: {1}", task.AssemblyLocation, ex.Message), null) }); return(null); } }
Assembly LoadContextAssembly(RunAssemblyTask task) { if (!File.Exists(task.AssemblyLocation)) { Server.TaskException(task, new[] { new TaskException("no type", String.Format("Could not load assembly from {0}: File does not exist", task.AssemblyLocation), null) }); return null; } AssemblyName assemblyName; try { assemblyName = AssemblyName.GetAssemblyName(task.AssemblyLocation); } catch (FileLoadException ex) { Server.TaskException(task, new[] { new TaskException("no type", String.Format("Could not load assembly from {0}: {1}", task.AssemblyLocation, ex.Message), null) }); return null; } if (assemblyName == null) { Server.TaskException(task, new[] { new TaskException("no type", String.Format("Could not load assembly from {0}: Not an assembly", task.AssemblyLocation), null) }); return null; } try { return Assembly.Load(assemblyName); } catch (Exception ex) { Server.TaskException(task, new[] { new TaskException("no type", String.Format("Could not load assembly from {0}: {1}", task.AssemblyLocation, ex.Message), null) }); return null; } }
Assembly LoadContextAssembly(RunAssemblyTask task) { AssemblyName assemblyName; if (!File.Exists(task.AssemblyLocation)) { Server.TaskExplain(task, String.Format("Could not load assembly from {0}: File does not exist", task.AssemblyLocation)); Server.TaskError(task, "Could not load context assembly"); return(null); } try { assemblyName = AssemblyName.GetAssemblyName(task.AssemblyLocation); } catch (FileLoadException ex) { Server.TaskExplain(task, String.Format("Could not load assembly from {0}: {1}", task.AssemblyLocation, ex.Message)); Server.TaskError(task, "Could not load context assembly"); return(null); } if (assemblyName == null) { Server.TaskExplain(task, String.Format("Could not load assembly from {0}: Not an assembly", task.AssemblyLocation)); Server.TaskError(task, "Could not load context assembly"); return(null); } try { return(Assembly.Load(assemblyName)); } catch (Exception ex) { Server.TaskExplain(task, String.Format("Could not load assembly from {0}: {1}", task.AssemblyLocation, ex.Message)); Server.TaskError(task, "Could not load context assembly"); return(null); } }
Assembly LoadContextAssembly(RunAssemblyTask task) { AssemblyName assemblyName; if (!File.Exists(task.AssemblyLocation)) { Server.TaskExplain(task, String.Format("Could not load assembly from {0}: File does not exist", task.AssemblyLocation)); Server.TaskError(task, "Could not load context assembly"); return null; } try { assemblyName = AssemblyName.GetAssemblyName(task.AssemblyLocation); } catch (FileLoadException ex) { Server.TaskExplain(task, String.Format("Could not load assembly from {0}: {1}", task.AssemblyLocation, ex.Message)); Server.TaskError(task, "Could not load context assembly"); return null; } if (assemblyName == null) { Server.TaskExplain(task, String.Format("Could not load assembly from {0}: Not an assembly", task.AssemblyLocation)); Server.TaskError(task, "Could not load context assembly"); return null; } try { return Assembly.Load(assemblyName); } catch (Exception ex) { Server.TaskExplain(task, String.Format("Could not load assembly from {0}: {1}", task.AssemblyLocation, ex.Message)); Server.TaskError(task, "Could not load context assembly"); return null; } }
public PerAssemblyRunListener(IRemoteTaskServer server, RunAssemblyTask runAssemblyTask) { _server = server; _runAssemblyTask = runAssemblyTask; }
private static string GetAssemblyFolder(TaskExecutorConfiguration config, RunAssemblyTask assemblyTask) { return(string.IsNullOrEmpty(config.AssemblyFolder) ? GetDirectoryName(assemblyTask.AssemblyLocation) : config.AssemblyFolder); }
public AssemblyRemoteTaskNotification(TaskExecutionNode node) { _node = node; _task = (RunAssemblyTask) node.RemoteTask; }
public AssemblyRemoteTaskNotification(TaskExecutionNode node) { _node = node; _task = (RunAssemblyTask)node.RemoteTask; }
private static string GetAssemblyFolder(TaskExecutorConfiguration config, RunAssemblyTask assemblyTask) { return string.IsNullOrEmpty(config.AssemblyFolder) ? GetDirectoryName(assemblyTask.AssemblyLocation) : config.AssemblyFolder; }