From: Patridge on 14 Jul 2010 15:37
I am trying to find a way to add a sub-application to an existing site via
appcmd command line.
I have tried to derive the syntax from various examples of modifying and
adding site bindings but the XML I need to generate doesn't quite fit with
those examples. I would like to result in the addition of the the following
XML to applicationHost.config under an existing site ("SomeSite" in the
example calls): "<application path="/subdir"><virtualDirectory path="/"
I have tried a number of variations on both "set config" and "add vdir" but
I cannot quite nail it down.
C:\>%windir%\System32\inetsrv\appcmd.exe set config "SomeSite"
==> "ERROR ( message:Cannot find requested collection element. )"
C:\>%windir%\System32\inetsrv\appcmd.exe add vdir /app.name:"SomeSite"
==> Creates a virtual directory on top of the sub-application directory in IIS
C:\>%windir%\System32\inetsrv\appcmd.exe add vdir
==> "ERROR ( message:Must use exact identifier for VDIR object with verb
If I could find a reference to the config syntax of brackets and periods,
especially regarding when to use a section name and when to use the attribute
breakdown, I would probably be able to work this out. Not finding such a
resource, though, I would appreciate any help I can get.