惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Attack and Defense Labs
Attack and Defense Labs
The GitHub Blog
The GitHub Blog
C
Check Point Blog
博客园_首页
MongoDB | Blog
MongoDB | Blog
N
Netflix TechBlog - Medium
F
Full Disclosure
Microsoft Security Blog
Microsoft Security Blog
爱范儿
爱范儿
Recent Announcements
Recent Announcements
阮一峰的网络日志
阮一峰的网络日志
G
GRAHAM CLULEY
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Threat Research - Cisco Blogs
C
Cybersecurity and Infrastructure Security Agency CISA
V
Vulnerabilities – Threatpost
K
Kaspersky official blog
博客园 - 司徒正美
S
Schneier on Security
T
The Exploit Database - CXSecurity.com
Project Zero
Project Zero
云风的 BLOG
云风的 BLOG
Cisco Talos Blog
Cisco Talos Blog
Know Your Adversary
Know Your Adversary
雷峰网
雷峰网
V
V2EX - 技术
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Spread Privacy
Spread Privacy
罗磊的独立博客
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
S
Security Affairs
SecWiki News
SecWiki News
Schneier on Security
Schneier on Security
O
OpenAI News
Jina AI
Jina AI
PCI Perspectives
PCI Perspectives
Cyberwarzone
Cyberwarzone
Y
Y Combinator Blog
Apple Machine Learning Research
Apple Machine Learning Research
B
Blog RSS Feed
I
InfoQ
D
Docker
P
Palo Alto Networks Blog
Recorded Future
Recorded Future
M
MIT News - Artificial intelligence
博客园 - Franky
B
Blog
Scott Helme
Scott Helme
博客园 - 叶小钗
D
DataBreaches.Net

博客园 - jianyi

SpringBoot - open-in-view 机制分析 w3wp CPU 100%问题解决 ShrePoint 迁移域控 SharePoint online 获取文件版本记录 SharePonit online 列表表单定制 VS2015 ionic 开发环境配置纪要 SharePoint 2016 - 安装QuickFlow2013 EF Migrations error: No connection string named 'MpDb' could be found in the application config file. TFS online 自动部署配置 SharePoint Permission Extension SharePoint暂时禁用事件触发 视图xsl定制之嵌入服务器控件 自定义View字段表头 自定义母版页之列表过滤菜单位置issue fix ListDefinition Tips QuickFlow UI 控件之 NamedFormAttachment - jianyi SharePoint 2010 GridView/SPGridView完全应用系统样式 QuickFlow-如何通过QFD and ExecuteCode获取其他列表数据 - jianyi DLL嵌入exe中 - jianyi
TFS online build change web.config
jianyi · 2017-04-03 · via 博客园 - jianyi

概要

TFS online 自动编译时如何修改web.config

ref:https://dustinoprea.com/2016/05/06/using-tokenization-token-replacement-for-buildsreleases-in-tfs-2015/

步骤

安装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)变量获取文件根路径。

另外,

1)若要使用_XXX_格式替换web.config 中的标记为变量,变量不支持系统内部变量,若要使用系统内置变量,如$(Build.SourceVersion)

可以新建一个用户变量,然后设置其值为$(Build.SourceVersion)

2)若config节点有namespace,则需要指定

{
"NamespaceUrl": "urn:schemas-microsoft-com:asm.v1",
"NamespacePrefix": "asm",
"KeyName": "/configuration/runtime/asm:assemblyBinding/asm:probing",
"Attribute": "privatePath",
"Value": "bin;binMP;binQF"
}