使用MSDeploy为程序包设置应用程序池 [英] Set Application Pool for package using MSDeploy

查看:314
本文介绍了使用MSDeploy为程序包设置应用程序池的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用MSDeploy部署网站,所以使用类似下面的代码。

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

"%ProgramFiles%\IIS\Microsoft Web Deploy\msdeploy.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.

应该没关系,但这是在IIS7中。

Shouldn't matter but this is in IIS7.

推荐答案

生成包时,需要在parameters.xml文件中有一个条目来设置应用程序池。部署时,您可以在setParameters.xml文件中包含该值,或者从命令行使用-setParam。

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.

这是我用来获取的命令site,生成了正确的parameters.xml文件...

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"

在parameters.xml文件中挖掘以查看必要的条目。如果您愿意, -setParam 条目可以存在于 params.xml 文件中。

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.

这篇关于使用MSDeploy为程序包设置应用程序池的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆