« Previous Next »

Thread: what permission need to call Microsoft.Web.Administration namespace?

Last post 07-13-2009 7:08 PM by lextm. 1 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (2 items)

Sort Posts:

  • 07-13-2009, 6:03 PM

    what permission need to call Microsoft.Web.Administration namespace?

    I have a windows service, which run through Network Service account. In this windows service, I have a method (c#) which call Microsoft.Web.Administration to get a physical path for a web application hosted on IIS 7 (win2k8 64bit server) :

    Site site = serverManager.Sites["Default Web Site"];

    Application app = site.Applications["/MyVirDir"];

    string s = app.Path;

    However, the windows service failed due to permission issue, changing windows service Identity to Local System made it work.

    However, I am not allowed to raise security level on this windows service. Are there any other options to get physical path?

    Thank you in advance

    Eunice
  • 07-13-2009, 7:08 PM In reply to

    • lextm
    • Top 10 Contributor
    • Joined on 10-22-2008, 12:18 AM
    • Shanghai, PRC
    • Posts 1,274

    Re: what permission need to call Microsoft.Web.Administration namespace?

     I am not sure if the account you use to run this service has enough rights to access %windir%\system32\inetsrv\config\applicationHost.config.

    If it can read that XML file, you can get almost all IIS settings from it.

    Lex Li
    Support Engineer at Microsoft
    ---------------------------
    This posting is provided "AS IS" with no warranties, and confers no rights.
Page 1 of 1 (2 items)