【发布时间】:2015-06-02 16:06:03
【问题描述】:
我创建了一个 wpp.targets 文件,它在 azure 中完成所有部署。我想在部署期间将 webconfig 的 appsetting 属性更改为 azure。我在http://sedodream.com/PermaLink,guid,25ddd39e-59de-4e35-becc-de19dcc5e4ea.aspx 中找到了一个示例,它使用了 pubxml 和 parameters.xml。我想使用 wpp.targets 而不是 pubxml。
<appSettings>
<!-- TODO: set this in the azure config -->
<add key="customer" value="xyz" />
</appSettings>
需要在部署期间将客户值更新为“客户端”,并且 web.config 文件应反映已部署文件夹中的更改,如下所示
<appSettings>
<add key="customer" value="client" />
</appSettings>
回答
我已经在 msDeploy 中使用了 ProjectParametersXMLFile
msbuild Api.csproj /p:ProjectParametersXMLFile="c:\parameter.xml"/p:PublishSettingsFile=%publishFileLocation%
【问题讨论】:
标签: c# azure msbuild web-config msbuild-wpp