[System.Runtime.InteropServices.COMException]{"未知错误(0x80005000)"} RRS feed

  • 问题


    I am curious about using System.DirectoryServices with IIS7. I have the need to configure multiple IIS servers, with versions ranging from IIS5 through IIS7 (the IIS 7 servers are currently running on Vista Ultimate). Whenever I create a DirectoryEntry using the following code on IIS7/VistaUltimate, just about everything throws System.Runtime.InteropServices.COMException: DirectoryEntry entry = new DirectoryEntry("IIS://localhost/W3SVC"); DirectoryEntry entry = new DirectoryEntry("IIS://localhost/W3SVC/1"); DirectoryEntry entry = new DirectoryEntry("IIS://localhost/W3SVC/1/ROOT"); I know there is this wonderful new Microsoft.Web.Administration namespace for administering IIS7, but that provides me with no value when I need to configure IIS5 and IIS6 servers as well. I do not have the desire nor time to write and maintain two sets of code to manage IIS7 differently than IIS5/6, so I am hoping there is something I can do to get standard System.DirectoryServices stuff working with IIS7. I am guessing there is some kind of permissions problem, but I havn't been able to find any other information about this problem. I greatly appreciate any help.
    2008年12月26日 7:37