Using the following C # code:
using System; using Microsoft.Web.Administration; namespace getftpstate { class Program { static void Main(string[] args) { ServerManager manager = new ServerManager(); foreach (Site site in manager.Sites) { Console.WriteLine("name: " + site.Name); Console.WriteLine("state: " + site.State); Console.WriteLine("----"); } } } }
I get the following output:
C:\projects\testiisftp\getftpstate\getftpstate\bin\Debug>getftpstate.exe name: Default Web Site state: Stopped ---- name: Default FTP Site Unhandled Exception: System.Runtime.InteropServices.COMException (0x800710D8): T he object identifier does not represent a valid object. (Exception from HRESULT: 0x800710D8) at Microsoft.Web.Administration.Interop.IAppHostProperty.get_Value() at Microsoft.Web.Administration.ConfigurationElement.GetPropertyValue(IAppHos tProperty property) at Microsoft.Web.Administration.Site.get_State() at getftpstate.Program.Main(String[] args) in C:\projects\testiisftp\getftpst ate\getftpstate\Program.cs:line 17
Any ideas by which I could see the above error 0x800710D8 COM? I can manage the FTP site simply using the IIS Manager (I can start, stop, change settings, etc.).
c # iis
Nick bolton
source share