The installer for our application includes the following bit of code:
public static ArrayList PopulateSites(string serverName)
{
ArrayList sites = new ArrayList();
DirectoryEntry w3svc = new DirectoryEntry("IIS://" + serverName + "/w3svc");DirectoryEntries webSites = w3svc.Children;
int id =0;
foreach(DirectoryEntry entry in webSites)
<snip>
Everything runs fine on our Windows 2003 servers, but now we are attempting to run our installer on a new Windows 2008 server with IIS7. When the code hits the last line above, it throws an Access Denied exception. The serverName variable is "localhost". The account I am logged in with is an adminstrator account. I have attempted to add II6 Metabase Compatability. Ive tried adding write permissions on the wwwroot directory to IIS_IUSRS. No change. At this point I'm stumped.
Any thoughts or suggestions?