How can I change a virtual directory's physical path in IIS7 and C#?
- by Nick
I need to change the where a virtual directory's physical path is in C#.
This is what I have so far:
using (DirectoryEntry webSiteRoot = WmiUtility.GetWebSiteRootDirectory(webSite))
{
DirectoryEntry virtualDirectory =
WmiUtility.GetVirtualDirectoryByName(webSiteRoot, vDirName);
string currentPath = virtualDirectory.Path;
virtualDirectory.Path = "C:\somepath"
srvMgr.CommitChanges();
It would appear that the VirtualDirectory.Path is not a physical one. Any help?