How do I target an already existing application pool with webdeploy?

限于喜欢 提交于 2019-11-27 03:29:45

问题


I am trying to make sure that my app gets deployed to a specific application pool that already exists when using Web Deploy. The application pool should be configurable by the user using the GUI when installing app through IIS Manager or by changing the value in the .setparameters.xml file when installing via the commandline from a web package. Inserting the following parameter entry into my parameters.xml doesn't do the trick.

<parameter name="Application Pool" description="Application Pool for this site" tags="iisApp" defaultValue="ASP.NET v4.0">
    <parameterEntry kind="providerPath" scope="IisApp" match="applicationPool" />
</parameter>

Is there a straightforward way to accomplish this? If not, how would I go about getting this done?


回答1:


Here's what I did to set the application pool via command line or SetParameters.xml after lots of reading on SO and elsewhere:

  1. Add a Parameters.xml file to the project.

    <?xml version="1.0" encoding="utf-8" ?>
    <parameters>
      <parameter name="AppPool" defaultValue="ASP.NET 4.0">
        <parameterEntry kind="DeploymentObjectAttribute" scope="application" match="applicationPool/@applicationPool" />
      </parameter>
    </parameters>
    
    • Sources:
      • How to specify MSDeploy parameters from MSbuild
      • http://vishaljoshi.blogspot.com/2010/07/web-deploy-parameterization-in-action.html
  2. Add two parameters to msbuild when creating the package:

    /P:IncludeIisSettings=true
    /P:IncludeAppPool=true
    
    • Source:
      • https://stackoverflow.com/a/13678143/448876
  3. Set via SetParameters.xml:

    <setParameter name="AppPool" value="Some AppPoolName"/>
    

    OR

    Using command line parameter (msdeploy or *.deploy.cmd):

    "-setParam:'AppPool'='Some AppPoolName'"
    


来源:https://stackoverflow.com/questions/15774122/how-do-i-target-an-already-existing-application-pool-with-webdeploy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!