如何使用MSDeploy配置应用程序池

如何使用MSDeploy配置应用程序池

问题描述:

我目前正在使用MSBuild通过传递参数来创建MSDeploy程序包:

I'm currently using MSBuild to create an MSDeploy package by passing in arguments:

/p:DeployOnBuild=true;DeployTarget=Package

我正在使用parameters.xml文件(位于我的网站的根目录). 另一个SO问题我发现尝试设置应用程序池.

I'm using a parameters.xml file (placed at the root of my website). Another SO question I found tries to set up the application pool.

我的parameters.xml文件:

My parameters.xml file:

<parameters>
    <parameter name="Application Pool Name" description="Application Pool for this site" tags="" defaultValue="ASP.NET v4.0">
        <parameterEntry kind="DeploymentObjectAttribute"
                        scope="application"
                        match="/application/@applicationPool" />
    </parameter>
...
</parameters>

但是,似乎由msbuild生成的msdeploy包中的archive.xml文件没有包含applicationPool元素的部分

but it seems that the archive.xml file inside the msdeploy package generated by the msbuild doesn't have an section with an applicationPool element

如何获取本节要生成的archive.xml,以便设置应用程序池?

How can I get the archive.xml to be generated with this section so that I can set the application pool?

我要设置的应用程序池已经存在,因此我不关心MSDeploy同步或在此处创建应用程序池.

The app pool I want to set will exist already, so I'm not concerned with MSDeploy synching or creating app pools here.

我发现了这个问题如何我如何控制用于通过VS&进行部署的AppPool? MSDeploy设置,提示使用wpp.targets生成自定义提供程序.我正在探索如何使用这种方法来修改archive.xml文件

I have found this question How do I control the AppPool used for deploy through VS & MSDeploy settings which hints at using wpp.targets to generate a custom provider. I'm exploring how to use this approach to modify the archive.xml file

假定您在项目上具有正确的IIS设置并以管理员身份运行,则应该能够指定IncludeIisSettings=true将该设置包含在zip中

Assuming you have the correct IIS settings on your project and are running as Administrator, you should be able to specify IncludeIisSettings=true to have the settings included in the zip.

如果需要包含实际的AppPool定义(以便可以创建),则还应该设置IncludeAppPool=true.

If you need the actual AppPool definition included (so it can be created), you should also set IncludeAppPool=true.