I would like to know if it possible to create a virtual directory in C# directly to a site instead of creating a web application and then linking a virtual directory to that. I am using iis 7. thanks ! Src:http://blogs.msdn.com/b/carlosag/archive/2006/04/17/microsoftwebadministration.aspx
You can do this in PowerShell.
PS IIS:\> New-Item 'IIS:\Sites\Default Web Site\DemoVirtualDir1' -type VirtualDirectory -physicalPath c:\test\virtualDirectory1