使用 MSDeploy 和 TFS 2010 设置应用程序池
我正在尝试使用 MSDeploy 来部署网站,并使用其中的一些进行团队构建...
/p:DeployOnBuild
/p:DeployTarget=MsDeployPublish
/p:CreatePackageOnPublish=True
/p:MSDeployPublishMethod=InProc
/p:MSDeployServiceURL=localhost
/p:DeployIISAppPath="Default Web Site"
有没有办法在自定义应用程序池中设置此网站?
I'm trying to deploy website with MSDeploy and team build using some of this ...
/p:DeployOnBuild
/p:DeployTarget=MsDeployPublish
/p:CreatePackageOnPublish=True
/p:MSDeployPublishMethod=InProc
/p:MSDeployServiceURL=localhost
/p:DeployIISAppPath="Default Web Site"
Is there a way to set this website in custom application pool?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您使用的是 IIS 7,则可以使用 appPoolProvider 将应用程序池同步到远程服务器。请参阅:
http://technet.microsoft.com/en- us/library/dd569070(WS.10).aspx
和
http: //blog.torresdal.net/2010/08/16/NoClickWebDeploymentPart2WebDeployAkaMsdeploy.aspx
但是,我无法真正让它正常工作,如果您使用的是 IIS 6,那么无论如何这都不起作用。不过,您可以利用 MSDeploy 在远程服务器上运行几个命令来设置应用程序池(并在网站上注册 .NET 版本)。
首先,创建一个包含类似于以下内容的批处理文件:
因此,如果 IIS 编号为 1,您的虚拟目录为“MyDirectory”并且应用程序池名为“.NET4.0”,则命令将为。
然后,您可以运行 MSDeploy,将此批处理文件作为参数传递并在远程计算机上运行它:
其中
<批处理文件的路径>
是您上面刚刚创建的批处理文件的完整路径,是您要运行此程序的计算机。以下是描述runCommand
参数的链接:http://technet.microsoft.com/en-us/library/ee619740(WS.10).aspx我确信您可以将其设置为 TFS 中的构建步骤。我们制作了一个小的 .NET 实用程序,将其作为部署过程的一部分进行调用,用于创建这些批处理文件并运行 MSDeploy 命令。
您还可以使用相同的方法执行其他可能对您有用的操作:
注册 IIS 版本:
创建应用程序池:
感谢 http://justsamson.com/2010/06/14/create-virtual-directory-in-iis-6-0- via-command-line/ 用于命令行脚本来执行各种功能。
If you're using IIS 7, you can use the appPoolProvider to sync application pools to a remote server. See:
http://technet.microsoft.com/en-us/library/dd569070(WS.10).aspx
and
http://blog.torresdal.net/2010/08/16/NoClickWebDeploymentPart2WebDeployAkaMsdeploy.aspx
However, I wasn't able to really get that to work well, and if you're using IIS 6 this won't work anyway. What you can do though is leverage MSDeploy to run a couple commands on the remote server to set the application pool (and register the .NET version on the website).
First, create a batch file that contains something similar to the following:
So, if the IIS number is 1, your virtual directory is "MyDirectory" and the App Pool is named ".NET4.0", the command would be.
You can then run MSDeploy, passing this batch file in as an argument and running it on the remote machine:
where
<path to batch file>
is the full path to the batch file you just created above, and is the computer against which you want to run this. Here is a link describing therunCommand
argument: http://technet.microsoft.com/en-us/library/ee619740(WS.10).aspxI'm sure you can set this up as a build step in TFS. We made a little .NET utility that we call as part of our deployment process that creates these batch files and runs the MSDeploy command.
There are also other things you can do in this same method that might prove useful to you:
Register an IIS version:
Create an App Pool:
Thanks to http://justsamson.com/2010/06/14/create-virtual-directory-in-iis-6-0-via-command-line/ for the command-line scripts to do the various functionality.
部分技巧在于
/p:IncludeAppPool=true
。这会更改部署脚本以启用 AppPoolExtension。但我还没有弄清楚如何最好地实际设置应用程序池。 :)Part of the trick is with
/p:IncludeAppPool=true
. That changes the deploy script to enable AppPoolExtension. But I haven't figured out how best to actually set the app pool yet. :)