« Previous Next »

Answered Thread: HELP REMOVING CONFIG FROM APPLICATIONHOST

Last post 11-06-2009 1:51 PM by CarlosAg. 5 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (6 items)

Sort Posts:

  • 11-03-2009, 9:10 AM

    • festivis
    • Not Ranked
    • Joined on 11-03-2009, 2:02 PM
    • Posts 3

    HELP REMOVING CONFIG FROM APPLICATIONHOST

    I'm using appcmd to set config in the applicationHost file for various applications. This works fine. However, I also have scripts that uninstall the applications. I use appcmd delete app "App Name". The problem is when executing this cmd is does not remove any config that may have been set in the applicationHost file. I noticed when deleting the app in IIS mgmt console it DOES remove any config from the applicationHost file. I also tried using the appcmd clear config with the /delete parameter but I get a "the data is invalid" error.

     Can anyone help me?

  • 11-06-2009, 3:49 AM In reply to

    Re: HELP REMOVING CONFIG FROM APPLICATIONHOST

    Can you provide some steps to reproduce the issue with commands?

    Steve Schofield
    Windows Server MVP - IIS
    http://weblogs.asp.net/steveschofield


    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget
  • 11-06-2009, 11:01 AM In reply to

    • festivis
    • Not Ranked
    • Joined on 11-03-2009, 2:02 PM
    • Posts 3

    Re: HELP REMOVING CONFIG FROM APPLICATIONHOST

    We'll run these cmds during install :

    appcmd add apppool /name:MyApp /managedPipelineMode:Integrated /processModel.identityType:NetworkService /processModel.idleTimeout:01:00:00

    appcmd add app /site.name:"Default Web Site" /path:/MyApp /physicalPath:"c:\inetpub\wwwroot\myapp" /applicationPool:MyApp

    appcmd set config "Default Web Site/MyApp" /section:anonymousAuthentication /enabled:true /commit:AppHost

    Then on an uninstall we do this :

    appcmd delete app "Default Web Site/MyApp"

    appcmd delete apppool MyApp

    After the install, the anonymousAuthentication section is added to the applicationHost.config file, as expected. However, after uninstall, the anonymousAuthentication section is still in the applicationHost.config file. If I run the setup, but then manually delete the application via the IIS mgmt console, the anonymousAuthentication section (actually, the entire MyApp location section) is removed. I would have expected the "appcmd delete app" to remove the MyApp location section from the applicationHost.config file, but it doesn't.

    I also tried the "appcmd clear config /section:anonymousAuthentication /delete /commit:AppHost" but I get a "the data is invalid" error.

  • 11-06-2009, 12:20 PM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 10:13 PM
    • Redmond, WA
    • Posts 2,343

    Answered Re: HELP REMOVING CONFIG FROM APPLICATIONHOST

    You cannot delete the location tag for the application using appcmd - you have to use either the AHAdmin COM interface of MWA managed interface to do it.

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 11-06-2009, 1:23 PM In reply to

    • festivis
    • Not Ranked
    • Joined on 11-03-2009, 2:02 PM
    • Posts 3

    Re: HELP REMOVING CONFIG FROM APPLICATIONHOST

    OK, but this has got to be a flaw. Anything I do with appcmd should be able to be undone with appcmd.

  • 11-06-2009, 1:51 PM In reply to

    Answered Re: HELP REMOVING CONFIG FROM APPLICATIONHOST

    Technically you can undo whatever action you make, for example you are not specifically creating a location tag, you are setting a configuration section for a specific path. This can be undone by using appcmd clear config "path" -section:"section" -delete . This will make sure to remove entirely the section that was added by your "appcmd set config".

    The thing that cannot be achieved right now is to be able to delete entirely a location path at once.

Page 1 of 1 (6 items)
Microsoft Communities