本文介绍了TFS 2015 Build vNext 递归变量替换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

变量替换是否有可能不是递归的?

Is it possible that the variable substitution is not recursive?

示例 1:

变量值

SqlInstance (localDb)\mssqllocaldb

SqlInstance (localDb)\mssqllocaldb

DbCatalogName FooDb

ConnStr 数据源=$(SqlInstance);初始目录=$(DbCatalogName)$(Build.BuildId);

ConnStr data source=$(SqlInstance);initial catalog=$(DbCatalogName)$(Build.BuildId);

在构建期间,连接字符串替换为:data source=(localDb)\mssqllocaldb;initial catalog=FooDb3211;

During the build the connection string substituted to: data source=(localDb)\mssqllocaldb;initial catalog=FooDb3211;

此配置完美运行.但是,如果我将 BuildId 参数移动到 DbCatalogName 变量,它将不会被替换.

This configuration works perfectly. But if i move the BuildId parameter to DbCatalogName variable it won't be substituted.

示例 2:

变量值

SqlInstance (localDb)\mssqllocaldb

SqlInstance (localDb)\mssqllocaldb

DbCatalogName FooDb$(Build.BuildId)

DbCatalogName FooDb$(Build.BuildId)

ConnStr 数据源=$(SqlInstance);初始目录=$(DbCatalogName);

ConnStr data source=$(SqlInstance);initial catalog=$(DbCatalogName);

使用此配置,连接字符串被替换为:data source=(localDb)\mssqllocaldb;initial catalog=FooDb$(Build.BuildId);

With this configuration the connection string is substituted to: data source=(localDb)\mssqllocaldb;initial catalog=FooDb$(Build.BuildId);

那么我如何用 vNext 链接变量?

So how can i chain variables with vNext?

推荐答案

变量链似乎适用于 TFS 2015 Update 3.

Variable chaining seems to work with TFS 2015 Update 3.

这篇关于TFS 2015 Build vNext 递归变量替换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 02:08