public void LoadProject(IProject project) { lock (_locker) { Teardown(); try { _publisher.Publish <BinaryRecycleStarted>(); _proxy = BuildProxy(project); _library = _proxy.StartSystem(new FixtureAssembly(project), (MarshalByRefObject)_publisher); _publisher.Publish(new BinaryRecycleFinished(_library)); } catch (FileNotFoundException ex) { if (ex.Message.Contains(GetType().Assembly.GetName().Name)) { string message = "Could not find the StoryTeller.dll assembly in the target AppDomain."; message += "\nYou will not be able to execute tests until the StoryTeller.dll file is copied to " + project.GetBinaryFolder(); _publisher.Publish(new BinaryRecycleFailure { ErrorMessage = message }); } else { _publisher.Publish(new BinaryRecycleFailure { ErrorMessage = ex.ToString() }); } Teardown(); } catch (Exception ex) { Teardown(); _publisher.Publish(new BinaryRecycleFailure { ErrorMessage = ex.ToString() }); } } }
public void Teardown() { try { if (_proxy != null) { _proxy.Dispose(); } } catch (Exception) { } _proxy = null; if (_domain != null) { AppDomain.Unload(_domain); _domain = null; } }
public void Teardown() { try { if (_proxy != null) _proxy.Dispose(); } catch (Exception) { } _proxy = null; if (_domain != null) { AppDomain.Unload(_domain); _domain = null; } }
public void Start(IProject project) { lock (_locker) { Teardown(); try { _publisher.Publish<BinaryRecycleStarted>(); _proxy = BuildProxy(project); _library = _proxy.BuildFixtureLibrary(); _publisher.Publish(new BinaryRecycleFinished(_library)); } catch (FileNotFoundException ex) { if (ex.Message.Contains(GetType().Assembly.GetName().Name)) { string message = "Could not find the StoryTeller.dll assembly in the target AppDomain."; message += "\nYou will not be able to execute tests until the StoryTeller.dll file is copied to " + project.GetBinaryFolder(); _publisher.Publish(new BinaryRecycleFailure { ErrorMessage = message }); } Teardown(); } catch (Exception ex) { Teardown(); _publisher.Publish(new BinaryRecycleFailure { ErrorMessage = ex.ToString() }); } } }
public void LoadProject(IProject project) { lock (_locker) { Teardown(); try { _publisher.Publish<BinaryRecycleStarted>(); _proxy = BuildProxy(project); _library = _proxy.StartSystem(new FixtureAssembly(project), (MarshalByRefObject)_publisher); _publisher.Publish(new BinaryRecycleFinished(_library)); _proxy.ImportEnvironment(StoryTellerEnvironment.Variables()); } catch (FileNotFoundException ex) { if (ex.Message.Contains(GetType().Assembly.GetName().Name)) { string message = "Could not find the StoryTeller.dll assembly in the target AppDomain."; message += "\nYou will not be able to execute tests until the StoryTeller.dll file is copied to " + project.GetBinaryFolder(); _publisher.Publish(new BinaryRecycleFailure { ErrorMessage = message }); } else { _publisher.Publish(new BinaryRecycleFailure { ErrorMessage = ex.ToString() }); } Teardown(); } catch (Exception ex) { Console.WriteLine(ex); Teardown(); _publisher.Publish(new BinaryRecycleFailure { ErrorMessage = ex.ToString() }); } } }