首页 > 解决方案 > Jenkins Freestyle 构建中 MSbuild 中的解决方案路径错误

问题描述

在 Jenkins 的 Freestyle 项目中使用 MSBuild 时出现以下错误

我想要的工作流程如下:

我安装了 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```

标签: c#jenkinsmsbuildjenkins-pipeline

解决方案


我通过将所有工作区文件 xcopy 到我也可以编写的目录中来解决它,并且问题解决了。


推荐阅读