Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8925657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:45:30+00:00 2026-06-15T07:45:30+00:00

I am on Windows XP. We have Windows 2008 Servers. Need to run IIS

  • 0

I am on Windows XP. We have Windows 2008 Servers. Need to run IIS Express until we get workstations or virtual machines with newer version of local O.S. for the real IIS 7.X.

Can I use DirectoryEntry to list my Sites and Virtual Directories when I run c# code under IIS Express? I have examples for setting up the Virtual Directories under IIS Express so that I think I have covered. Now I want to list them to ensure they exist.

Anyone know how to do this in C#? Just a small snippet of what I have been trying causes com exceptions…

DirectoryEntry iisServer = new DirectoryEntry("IIS://localhost/W3SVC/1");
DirectoryEntry folderRoot = iisServer.Children.Find("Root", "/");
var children = folderRoot.Children;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T07:45:31+00:00Added an answer on June 15, 2026 at 7:45 am

    you can try something like this

    void ListVirtualDirectories(string serverName, int siteId)
    {            
           DirectoryEntry iisServer = new DirectoryEntry("IIS://" + serverName + "/W3SVC/" + siteId + "/ROOT");
    
           foreach (DirectoryEntry webDir in iisServer.Children)
           {
               if (webDir.SchemaClassName.Equals("IIsWebVirtualDir"))
                   Console.WriteLine("Found virtual directory {0}", webDir.Name);
           }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have installed SQL Server 2008 R2 Express on Windows 7. When I run
I have a Windows 2008 Server with IIS 7 which using a .NET C#
I have a Windows 2008 R2 Server running IIS 7.5. Currently, I use WCF
I run IIS 7.5 on Windows Server 2008 R2. I'm getting a 404: file
I need to complete a series of tasks across several Windows 2008 servers that
I am running PHP 5.3.8 non-thread-safe version with IIS 7 on windows server 2008
We have Windows Server 2008 as our Production server hosted in RackSpace environment. Following
I'm battling a really weird problem here. I have a Windows 2008 R2 server
I have Visual Studio 2008 and the Windows SDK for Windows Server 2008 and
we have the following environment: a Windows 2008 Server with Apache 2.2.14 and SVN

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.