I have one website as you see below.
I am trying to remove my virtual path which is called "devtest".
I tried these code to remove but always "Application" comes null.
private static void RemoveVirtualDirectory()
{
using (ServerManager mgr = new ServerManager())
{
Application app = mgr.Sites["deneme.com"].Applications["/devtest"];
mgr.Sites["deneme.com"].Applications.Remove(app);
mgr.CommitChanges();
}
}
Do you have a better way to delete virtual directory?

I solved like below: