public void CleanVsExperimentalInstance() { if (!_keepDirtyVsInstance) { // wait for removal of locks on some files we want to delete // TODO: find more reliable method than using Sleep() Thread.Sleep(TimeSpan.FromSeconds(1)); VisualStudioInstance.Clean(); } VisualStudioInstance = null; }
public void SetupVanillaVsExperimentalInstance(string suffix, string typename) { AskIfNotOnBuildServerAndProductiveVs(suffix); try { VisualStudioInstance = new VsExperimentalInstance(TestMetadata.Versions.VS2015, suffix); if (string.IsNullOrEmpty(suffix)) { _keepDirtyVsInstance = true; VisualStudioInstance.InstallExtension(_vsixPath); } else { if (!_keepDirtyVsInstance) { _keepDirtyVsInstance = AskToCleanIfExists(); } if (!_keepDirtyVsInstance) { VisualStudioInstance.FirstTimeInitialization(); VisualStudioInstance.InstallExtension(_vsixPath); } } } // ReSharper disable once RedundantCatchClause // ReSharper disable once UnusedVariable catch (Exception exception) { var wrapper = new AutomationException( $"Exception caught: {exception.GetType().Name}", exception.Message, exception); wrapper.LogAndThrow(typename); } }