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

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

问题描述

我正在使用 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.

应该没关系,但这是在 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.

这是我用来抓取网站的命令,它生成了正确的 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天全站免登陆