Previous Next

Thread: ServerManager.OpenRemote and new application pools

Last post 06-12-2008 8:46 PM by CarlosAg. 2 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (3 items)

Sort Posts:

  • 05-08-2008, 7:17 PM

    • mmtom
    • Not Ranked
    • Joined on 05-08-2008, 11:02 PM
    • Royal Oak, MI
    • Posts 2

    ServerManager.OpenRemote and new application pools

    I'm working on an application that will allow my team to deploy new sites to all of our IIS7 servers from a remote ClickOnce application using MWA.

     If I run the application from the target server (let's say SERVER01), it works. I'm able to create my AD account for the application pool ID, create the app pool, set the ID, create the site, and add the site to the app pool. Here's the code for the part that is failing:

    ServerManager IISAdmin = ServerManager.OpenRemote(ServerName);

    ApplicationPool appPool = IISAdmin.ApplicationPools.Add(ApplicationName);

    The first line works. It will connect to the remote server. When I attempt to add the new application pool, I get an exception that looks like this:

    Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Web.Administration.Interop.IAppHostWritableAdminManager'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{FA7660F6-7B3F-4237-A8BF-ED0AD0DCBBD9}' failed due to the following error: Interface not registered (Exception from HRESULT: 0x80040155). at Microsoft.Web.Administration.ConfigurationManager.CreateWritableAdminManager(WebConfigurationMap webConfigMap, String configPathToEdit, Boolean isAdminConfig) at Microsoft.Web.Administration.ConfigurationManager.CreateConfiguration(WebConfigurationMap configMap, String configPathToEdit, Boolean isAdminConfig) at Microsoft.Web.Administration.ConfigurationManager.GetConfiguration(String rawConfigurationPath, String cacheKey, Boolean isAdminConfig) at Microsoft.Web.Administration.ServerManager.get_ApplicationPoolsSection() at Microsoft.Web.Administration.ServerManager.get_ApplicationPools() at Rock.QL.WET.PushApp.IISConfig.ConfigureSite.CreateAppPool(String ServerName, String ApplicationName, String ServiceAccountName, String Password, String Domain)

     

     It works locally, but not remotely. SERVER01 is on Server 2008, DESKTOP01 is on Vista SP1. I'm running the application as an account that has admin rights on the remote server.

     

    I've been fighting with this for quite some time, so any help would be greatly appreciated.

    Tom Moser
    www.phishthis.com
  • 05-08-2008, 7:54 PM In reply to

    • mmtom
    • Not Ranked
    • Joined on 05-08-2008, 11:02 PM
    • Royal Oak, MI
    • Posts 2

    Re: ServerManager.OpenRemote and new application pools

    Turns out, I acutally need IIS7 and the management tools installed on the machine where I'm running the application from. I installed IIS7 on my Vista box and now the app works. I also ran it from another 2008 box with IIS7 and it works.

    Does anybody know if I can add references to something in my app to make this work anywhere, or am I going to need to have IIS7 installed anywhere I run the application?

    Tom Moser
    www.phishthis.com
  • 06-12-2008, 8:46 PM In reply to

    Re: ServerManager.OpenRemote and new application pools

    In order to use Microsoft.Web.Administration you need to have IIS installed, at the bare minimum you need to install the Configuration API's which are brought through installing the Management Tools.

    Unfortunately there is no SDK that enables this and it has several dependencies on other components that wouldn't let you just take it to another machine and make it work (such as COM objects, DLL's, etc).

Page 1 of 1 (3 items)
Page view counter