« Previous Next »

Thread: administration pack system.webServer/handlers collection count is different from C# program

Last post 08-31-2009 3:35 AM by bacan01. 2 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (3 items)

Sort Posts:

  • 08-28-2009, 10:00 AM

    • bacan01
    • Not Ranked
    • Joined on 08-28-2009, 9:56 AM
    • Posts 4

    administration pack system.webServer/handlers collection count is different from C# program

    Folks,

    i wrote the following pgm and the count returned by administration pack and this program is different. I had added an entry using administration pack which is not getting reflected in this program i guess.

                ServerManager servermanager = new ServerManager();
    
                Configuration config = servermanager.GetApplicationHostConfiguration();
    
                ConfigurationSection handlersSections = config.GetSection("system.webServer/handlers", "test");
                
                Console.Out.WriteLine("Count: " + handlersSections.GetCollection().Count);
    
     
    thanks
    bekz 
  • 08-28-2009, 12:19 PM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 6:13 PM
    • Redmond, WA
    • Posts 2,343

    Re: administration pack system.webServer/handlers collection count is different from C# program

    You probably want to do GetWebConfiguration rather than GetApplicationHostConfiguration.

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 08-31-2009, 3:35 AM In reply to

    • bacan01
    • Not Ranked
    • Joined on 08-28-2009, 9:56 AM
    • Posts 4

    Re: administration pack system.webServer/handlers collection count is different from C# program

    Thanks, its displaying the count properly now!

    i would like to know why this was different if i use application configuration? Is there any documentation on this?

     

    regards

    bekz

Page 1 of 1 (3 items)
Microsoft Communities