/// <summary> /// Delete all applications and cleanup. /// </summary> public static void CleanUp() { if (isInitialized) { lock (lockObj) { if (isInitialized) { SdkEventListener.Dispose(); EtwSession.Stop(); Aspx451TestWebApplication.Remove(); Aspx451TestWebApplicationWin32.Remove(); if (RegistryCheck.IsNet46Installed) { // .NET 4.6 onwards, there is no need of installing agent } else { string installerPath = ExecutionEnvironment.InstallerPath; Installer.InstallProduct(installerPath, "REMOVE=ALL"); Iis.Reset(); } isInitialized = false; } } } }
public static void MyClassCleanup() { AzureStorageHelper.Cleanup(); DeploymentAndValidationTools.CleanUp(); Aspx451TestWebApplication.Remove(); Aspx451TestWebApplicationWin32.Remove(); Trace.TraceInformation("IIS Restart begin."); Iis.Reset(); Trace.TraceInformation("IIS Restart end."); Trace.TraceInformation("HttpTests class cleaned up"); }