Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
762 views
in Technique[技术] by (71.8m points)

iis 7 - Set Application Pool for package using MSDeploy

I am deploying a website using MSDeploy so using something like the below code.

"%ProgramFiles%IISMicrosoft Web Deploymsdeploy.exe" 
     -verb:sync
     -source:package=WebAppServer.zip 
     -dest:Auto 
     -setParamFile="was_params.xml" 
     -verbose 
          >  webappserversync.log

Is there anyway to set the application pool ? I want to do this from the command line and not set it in a manifest or anything like that.

Shouldn't matter but this is in IIS7.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

When you generate your package, you need to have an entry in the parameters.xml file for setting the Application Pool. When deploying, you either include a value for that in your setParameters.xml file, or use -setParam from the command line.

Here is the command I used to grab a site, which generated the proper parameters.xml file ...

msdeploy.exe 
  -verb:sync -source:appHostConfig="Default Web Site" 
  -enableLink:AppPoolExtension 
  -dest:package=site.zip 
  -declareParam:name="Application Pool",
       defaultValue="Default Web Site",
       description="Application pool for this site",
       kind=DeploymentObjectAttribute,
       scope=appHostConfig,
       match="application/@applicationPool"

And to install this site from the command line, this ...

msdeploy.exe 
    -verb:sync 
    -dest:appHostConfig="MagicSite" 
    -enableLink:AppPoolExtension 
    -source:package=site.zip 
    -setParam:"Application Pool"="MagicPool"

Dig around in the parameters.xml file to see the entry necessary. And if you prefer, that -setParam entry can exist in your params.xml file instead.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...