.NET CI 生成有时会失败

本文关键字:失败 CI NET | 更新日期: 2023-09-27 18:36:43

如何

使此构建设置一致地工作?

我有一个有时会失败的构建设置。

如果我重试构建,它可能会成功,也可能不会成功。

我的构建环境似乎有问题。

环境:

  • GitLab CI Multi Runner
  • 视窗服务器 2012
  • 运行器作为管理员用户。

GitLab CI Multi Runner Configuration:

concurrent = 1
[[runners]]
  url = "http://gitlab.xxxxx.com/ci"
  token = "xxxxxxxxxxxxxxxxxxxxxxx"
  tls-skip-verify = false
  tls-ca-file = ""
  name = "XXXXXXX"
  executor = "shell"

溶液:

  • 2 个 C# 控制台应用程序
  • SQL Server 2014 数据库
  • C# 单元测试项目
  • NuGet
    • 实体框架

构建输出:

gitlab-ci-multi-runner 0.7.2 (998cf5d)
Using Shell executor...
Running on XXXXXXX...
Cloning repository...
Cloning into 'C:'Multi-Runner'builds'db00f967'0'xxxxx-log-parser'...
Checking out 344bae64 as master...
devenv "Solution'xxxxx-log-parser.sln" /build Release
Microsoft Visual Studio 2015 Version 14.0.24720.0.
Copyright (C) Microsoft Corp. All rights reserved.
1>------ Build started: Project: xxxxx-database, Configuration: Release Any CPU ------
1>  C:'Windows'Microsoft.NET'Framework'v4.0.30319'Csc.exe /noconfig /nowarn:1701,1702,2008 /nostdlib+ /errorreport:prompt /warn:4 /define:TRACE /errorendlocation /preferreduilang:en-US /highentropyva+ /reference:"C:'Program Files (x86)'Reference Assemblies'Microsoft'Framework'.NETFramework'v4.5'mscorlib.dll" /debug:pdbonly /optimize+ /out:obj'Release'xxxxx_database.dll /subsystemversion:6.00 /target:library /warnaserror- /utf8output "C:'Users'user'AppData'Local'Temp'.NETFramework,Version=v4.5.SqlClrAttributes.cs"
1>  Loading project references...
1>  Loading project files...
1>  Building the project model and resolving object interdependencies...
1>  Validating the project model...
1>  Writing model to C:'Multi-Runner'builds'db00f967'0'xxxxx-log-parser'Solution'xxxxx-database'obj'Release'Model.xml...
1>  xxxxx-database -> C:'Multi-Runner'builds'db00f967'0'xxxxx-log-parser'Solution'xxxxx-database'bin'Release'xxxxx_database.dll
1>  xxxxx-database -> C:'Multi-Runner'builds'db00f967'0'xxxxx-log-parser'Solution'xxxxx-database'bin'Release'xxxxx-database.dacpac
2>------ Build started: Project: xxxxx-log-parser, Configuration: Release Any CPU ------
2>  xxxxx-log-parser -> C:'Multi-Runner'builds'db00f967'0'xxxxx-log-parser'Solution'xxxxx-log-parser'bin'Release'xxxxx-log-parser.exe
3>------ Build started: Project: xxxxx-log-parser-tests, Configuration: Release Any CPU ------
4>------ Build started: Project: xxxxx-log-processor, Configuration: Release Any CPU ------
ERROR: Build failed with: exit status 255 

.NET CI 生成有时会失败

切换到

MSBuild解决了我的问题。
我不应该使用devenv.exe