本文介绍了如何为部署页面设置< project> .SetParameters.xml的默认值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在构建过程中,msbuild为我的多个Web项目(和wcf服务)创建了部署程序包,我想从命令行运行该程序包(作为自动构建过程的最后一步),以部署到多个不同的服务器上

During build msbuild creates deployment packages for several my web projects (and wcf services)  which I want to run from command line (as last step of automated build process) to deploy to several different servers.

每个IIS应用程序文件夹的结构都相同.

The structure of IIS application folders is the same on each one.

我的问题是我找不到配置方法(覆盖IIS应用程序的默认值).它位于< project> .SetParameters.xml中,例如:

My problem is that I cannot find how to configure (override default value of IIS application). It is in <project>.SetParameters.xml, like:

< setParameter name ="IIS Web应用程序名称"; value =默认网站/OccApiAppZoneWcfWeb_deploy"; />

<setParameter name="IIS Web Application Name" value="Default Web Site/OccApiAppZoneWcfWeb_deploy" />

这不是我想要的.

我了解到可以在项目中创建parameter.xml并放置如下内容:

I read that it is possible to create parameters.xml in the project and put there something like:

<参数 名称 = " IIS Web应用程序名称 " 默认值 = "" 默认 网站//foo/bar/MySuperTodoList " >

<parametername="IIS Web Application Name"defaultValue="Default Web Site//foo/bar/MySuperTodoList">

或有人说

< setParameter name ="IIS Web应用程序名称"     value =默认网站///foo/bar/MySuperTodoList" />

<setParameter name="IIS Web Application Name"     value="Default Web Site///foo/bar/MySuperTodoList" />

我正在尝试此操作,但它不会更改< project> .SetParameters.xml

I'm trying this but it does not change content of <project>.SetParameters.xml

您能告诉我我想念的是什么,或/和做这件事的替代方法.

Can you advice what am I missing, or/and alternative way to do this.

谢谢!

推荐答案

如果您要手动部署Web应用程序包(通过运行.deploy.cmd文件或通过从命令行运行MSDeploy.exe),没有什么可以阻止您手动编辑SetParameters.xml文件部署之前. 但是,如果您使用的是企业级解决方案,则可能需要将网络应用程序包部署为大型的自动构建和部署过程的一部分.在这种情况下,您需要Microsoft Build Engine(MSBuild)来修改SetParameters.xml文件 为你.您可以通过使用MSBuild  XmlPoke 任务来做到这一点.

If you want to deploy the web application package manually—either by running the .deploy.cmd file or by running MSDeploy.exe from the command line—there's nothing to stop you manually editing the SetParameters.xml file prior to the deployment. However, if you’re working on an enterprise-scale solution, you may need to deploy a web application package as part of a larger, automated build and deployment process. In this scenario, you need the Microsoft Build Engine (MSBuild) to modify the SetParameters.xml file for you. You can do this by using the MSBuild XmlPoke task.

有关更多信息,请参阅:

For more information, please refer to: https://www.asp.net/web-forms/overview/deployment/web-deployment-in-the-enterprise/configuring-parameters-for-web-package-deployment

最诚挚的问候,

吴可乐


这篇关于如何为部署页面设置&lt; project&gt; .SetParameters.xml的默认值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-16 06:31