标签:generate path uil .json online epo 内置变量 pos releases
TFS online 自动编译时如何修改web.config
安装Release Management Utility tasks
https://marketplace.visualstudio.com/items?itemName=ms-devlabs.utilitytasks
将 Tokenizer 添加进BuildStep
http://blogs.blackmarble.co.uk/blogs/rfennell/post/2016/03/01/A-vNext-build-task-and-PowerShell-script-to-generate-release-notes-as-part-of-TFS-vNext-build
编写webConfigReplace.json,并提交到tfs
{ "default": { "CustomVariables": { "Variable1": "value1", "Variable2": "value2" }, "ConfigChanges": [ { "KeyName": "/configuration/metaModel", "Attribute":"configSource", "Value":"Config\\MetaModel.config" }, { "KeyName": "/configuration/connectionStrings", "Attribute": "configSource", "Value": "Config\\ConnectionStrings.config" } , { "KeyName": "/configuration/runtime/assemblyBinding/probing", "Attribute": "privatePath", "Value": "bin;binMP;binQF" } , { "KeyName": "/configuration/system.web/compilation", "Attribute":"debug", "Value":"false" } ] } }
注意:此处default为Environment name,若未配置Environment name,则指定default即可
配置Configuration Json filename: $(Build.Repository.LocalPath)/src/XXX/webConfigReplace.json
注意,此处必须使用$(Build.Repository.LocalPath)变量获取文件根路径。
另外,若要使用_XXX_格式替换web.config 中的标记为变量,变量不支持系统内部变量,若要使用系统内置变量,如$(Build.SourceVersion)
可以新建一个用户变量,然后设置其值为$(Build.SourceVersion)
TFS online build change web.config
标签:generate path uil .json online epo 内置变量 pos releases
原文地址:http://www.cnblogs.com/jianyi0115/p/6663452.html