private void OnSolutionProjectChanged(object sender, SolutionEventsListenerEventArgs e) { if (e != null) { var files = FindPs1Files(e.Project); if (e.ChangedReason == SolutionChangedReason.Load) { UpdateFileWatcher(files, true); } else if (e.ChangedReason == SolutionChangedReason.Unload) { UpdateFileWatcher(files, false); } } // Do not fire OnTestContainersChanged here. // This will cause us to fire this event too early before the UTE is ready to process containers and will result in an exception. // The UTE will query all the TestContainerDiscoverers once the solution is loaded. }
private void OnSolutionProjectChanged(object sender, SolutionEventsListenerEventArgs e) { _logger.Log(MessageLevel.Diagnostic, "PowerShellTestContainerDiscoverer:OnSolutionProjectChanged"); if (e != null) { IEnumerable<string> files = FindPs1Files(e.Project); if (e.ChangedReason == SolutionChangedReason.Load) { _logger.Log(MessageLevel.Diagnostic, "PowerShellTestContainerDiscoverer:OnTestContainersChanged - Change reason is load"); UpdateFileWatcher(files, true); } else if (e.ChangedReason == SolutionChangedReason.Unload) { _logger.Log(MessageLevel.Diagnostic, "PowerShellTestContainerDiscoverer:OnTestContainersChanged - Change reason is unload"); UpdateFileWatcher(files, false); } } // Do not fire OnTestContainersChanged here. // This will cause us to fire this event too early before the UTE is ready to process containers and will result in an exception. // The UTE will query all the TestContainerDiscoverers once the solution is loaded. }