c# - Jenkins Freestyle 构建中 MSbuild 中的解决方案路径错误
问题描述
在 Jenkins 的 Freestyle 项目中使用 MSBuild 时出现以下错误
我想要的工作流程如下:
- git clone repo 到工作区(成功)
- MSbuild 来自 repo 的 SLN 文件(显然失败。
- 构建成功后,将文件移动到网络映射文件夹
我安装了 MSbuild 插件,并将整个路径粘贴到它克隆存储库后存在的 SLN 文件。
我究竟做错了什么?
编辑:
这是整个构建日志:
Building in workspace C:\Windows\system32\config\systemprofile\AppData\Local\Jenkins\.jenkins\workspace\TAPPISAFE-Pipeline
[WS-CLEANUP] Deleting project workspace...
[WS-CLEANUP] Deferred wipeout is used...
[WS-CLEANUP] Done
The recommended git tool is: NONE
using credential JenkinsGitbucket
Cloning the remote Git repository
Cloning repository https://agile.tappi.org/gitbucket/git/root/TAPPISAFE.git
> git.exe init C:\Windows\system32\config\systemprofile\AppData\Local\Jenkins\.jenkins\workspace\TAPPISAFE-Pipeline # timeout=10
Fetching upstream changes from https://agile.tappi.org/gitbucket/git/root/TAPPISAFE.git
> git.exe --version # timeout=10
> git --version # 'git version 2.11.1.windows.1'
using GIT_ASKPASS to set credentials Jenkins Gitbucket
> git.exe fetch --tags --progress -- https://agile.tappi.org/gitbucket/git/root/TAPPISAFE.git +refs/heads/*:refs/remotes/origin/* # timeout=10
> git.exe config remote.origin.url https://agile.tappi.org/gitbucket/git/root/TAPPISAFE.git # timeout=10
> git.exe config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
Avoid second fetch
> git.exe rev-parse "refs/remotes/origin/master^{commit}" # timeout=10
Checking out Revision 03661da9c578e2dfc33ca5594b3e16dd8cf0650a (refs/remotes/origin/master)
> git.exe config core.sparsecheckout # timeout=10
> git.exe checkout -f 03661da9c578e2dfc33ca5594b3e16dd8cf0650a # timeout=10
Commit message: "Merge pull request #1 from root/brenden-master"
> git.exe rev-list --no-walk 03661da9c578e2dfc33ca5594b3e16dd8cf0650a # timeout=10
Path To MSBuild.exe: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
Executing the command cmd.exe /C " chcp 1252 & C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe Tappisafe.Web.sln " && exit %%ERRORLEVEL%% from C:\Windows\system32\config\systemprofile\AppData\Local\Jenkins\.jenkins\workspace\TAPPISAFE-Pipeline
[TAPPISAFE-Pipeline] $ cmd.exe /C " chcp 1252 & C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe Tappisafe.Web.sln " && exit %%ERRORLEVEL%%
Active code page: 1252
Microsoft (R) Build Engine version 4.8.3761.0
[Microsoft .NET Framework, version 4.0.30319.42000]
Copyright (C) Microsoft Corporation. All rights reserved.
MSBUILD : error MSB1009: Project file does not exist.
Switch: Tappisafe.Web.sln
Build step 'Build a Visual Studio project or solution using MSBuild' marked build as failure
Finished: FAILURE```
解决方案
我通过将所有工作区文件 xcopy 到我也可以编写的目录中来解决它,并且问题解决了。
推荐阅读
- parallel-processing - 变体调用管道并行化:错误 - “sbatch:未找到提交作业脚本时出错(退出代码 127)”
- android-studio - Ionic Live Reload 无法在 Android 手机上加载应用程序
- azure - 如何将数据从 .net 核心 api 发送到 azure 日志分析
- python - Python如果mysql行不等于输入
- reactjs - 从 MapContainer 外部渲染 Map 子节点
- azure - @azure/identity node.js 无法进行身份验证
- redis - Redis 集群问题
- checkbox - 单击时 SwiftUI 复选框未显示复选标记
- apache-spark - 将 Spark DataFrame 写入 Kafka 是忽略分区列和 kafka.partitioner.class
- node.js - Json.parse 抛出:“SyntaxError:JSON 输入意外结束”