visual-studio - Visual Studio 团队服务构建定义 : set database connection string

标签 visual-studio msbuild continuous-integration mstest azure-devops

我们使用 Entity Framework 6 和 MS SQL 服务器进行数据库集成测试 (MSTests)。

我正在寻找一种内置方法来在 Visual Studio Team Services (VSTS) 构建定义中的测试程序集的 app.confing 中设置数据库连接字符串。

这可以使用构建变量或其他一些简洁的内置方式来完成吗?

考虑的其他选项(未能找到更好的方法):

  1. 使用 *.runsettings 获取创建新构建的连接详细信息
  2. 通过 app.config 转换进行配置 (SlowCheetah)

最佳答案

您可以使用Replace Tokens任务。这将允许您用构建定义中的变量替换配置文件中的字符串。

关于visual-studio - Visual Studio 团队服务构建定义 : set database connection string,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37554697/

相关文章:

c++ - 从 'ClassType<std::unique_ptr<Base>>' 创建 'std::unique_ptr<Derived>' 时出现 (/permissive-) 的编译错误

c# - 导入的类型被定义多次 - 仅在 Mono 2.10.1 的 xbuild 下

entity-framework - 使用 MSBuild 构建 Entity Framework 模型而不使用项目文件?

java - Maven with Nexus - 由 : java. util.zip.ZipException 引起:打开 zip 文件时出错

Git:持续集成,避免 rebase 困惑

c# - 在 Visual Studio 中预构建事件

c++ - 在包含 Eigen 类型的类上使用 ` Eigen::aligned_allocator` on `std::vector`

.net - 适用于 Visual Studio > 2010 的 Microsoft SQL Server 特定解析器和脚本生成器?

.net - “dotnet Restore”与 TeamCity 中的 'nuget restore'

continuous-integration - CRM 2011在线插件上传程序以支持CI