Create IIS6 or IIS7 virtual directory on a website with hostheader, with C# and NANT

using System; using System.DirectoryServices; using System.Globalization; using Ada.Configurator.Common; using NAnt.Core.Attributes; using NAnt.Core; namespace AdaNantTasks { [TaskName("createWebSite")] public class CreateWebsiteTask : Task { public NantLogger logger = new NantLogger(); private string m_server; [TaskAttribute("server", Required = true)]…

Determine if an IIS website or IIS virtualdirectory exist, that run under a given applicationpool, with C#

To call this function use: DoesAppPoolHaveWebsites(new DirectoryEntry(string.Format("IIS://{0}/w3svc", "localhost")), "appPoolName")  /// <summary> /// Determine if a IIS website running under an applicationpool exists. /// </summary> /// <returns></returns> public bool DoesAppPoolHaveWebsites(DirectoryEntry iisEntry, string appPoolName) { bool result…