Previous Next

Thread: Metabase Identifier Not Recognized in ServiceController()

Last post 06-26-2008 11:09 PM by Zhao Ji Ma - MSFT. 1 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (2 items)

Sort Posts:

  • 06-19-2008, 3:00 PM

    • jabailo
    • Top 200 Contributor
    • Joined on 11-12-2007, 3:17 PM
    • Posts 18

    Metabase Identifier Not Recognized in ServiceController()

    • Windows 2000
    • IIS 5.0 
    • c# application

    I have a website under IIS.   It is identified in MetaEdit as 10, and also its logfile is placed in the W3SVC10 directory.

     Yet when I try to access it with this code (which works for other websites on the same machine),

    ServiceController oSC;
    oSC =
    new ServiceController("W3SVC/10");
    oSC.Start();

    This exception is thrown:

    System.InvalidOperationException: Service W3SVC/10 was not found on computer '.'. ---> System.ComponentModel.Win32Exception: The specified service does not exist as an installed service
     

    John Bailo
  • 06-26-2008, 11:09 PM In reply to

    Re: Metabase Identifier Not Recognized in ServiceController()

    Hi, 

    ServiceController is used to control Windows service, it is true that you are able to control World Wide Web Publishing Service (W3SVC), but it is not used on a per web site basis. To start or stop web site in IIS you can use DirectoryEntry class.

     

    Zhao Ji Ma
    Sincerely,
    Microsoft Online Community Support

    “Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
Page 1 of 1 (2 items)
Page view counter