Using appcmd to add a new website issue
I am using VSTS 2008 + C # + .Net 3.5 + IIS 7.0. I want to use appcmd to add a new website, my script looks like this.
- All my website files are in the c: \ template folder;
- I want to add my new website as a virtual directory under the default website, the virtual directory is called "testsite1";
- I want to use the default application pool (or the application pool that uses the default website).
I came up with appcmd quite a while ago but can't figure it out. Maybe I'm too stupid, or because IIS 7.0 / appcmd is new, the help information is limited. :-)
Please rate if someone can tell me how to complete the deployment task using appcmd?
thanks in advance george
+2
source to share
1 answer
- You have to open command prompt as administrator
-
Do the following:
"%windir%\system32\inetsrv\AppCmd" add app /site.name:"Default Web Site" /path:/testsite1 /physicalPath:"c:\template"
How did I know this? I did the following:
appcmd add app /?
and there was this example:
appcmd add app /site.name:"Default Web Site" /path:/app1
so i just added physicalPath
+8
source to share