尽管插入插入
这是我工作的简化版本的Jenkinsfile。
pipeline {
agent any
tools {
msbuild 'MSBuild 17'
}
stages {
stage('Build') {
steps {
pwsh ('''
nuget restore "${env:workspace}/Sandbox.sln"
msbuild "${env:workspace}/Sandbox.sln" /clp:ErrorsOnly -t:build -verbosity:diag -property:Configuration=Release -property:RestorePackages=true
''')
}
}
}
}
我在“全局配置工具”中定义了多个版本的MSBuild。我不断收到未被视为内部或外部命令,可操作程序或批处理文件
我尝试了withenv('msbuild 17'){...}
任何一个。
有人有提示如何解决这个问题吗?
This is a simplified version of Jenkinsfile that I work on;
pipeline {
agent any
tools {
msbuild 'MSBuild 17'
}
stages {
stage('Build') {
steps {
pwsh ('''
nuget restore "${env:workspace}/Sandbox.sln"
msbuild "${env:workspace}/Sandbox.sln" /clp:ErrorsOnly -t:build -verbosity:diag -property:Configuration=Release -property:RestorePackages=true
''')
}
}
}
}
I have defined multiple versions of MSBuild in "Global Configuration Tool". I keep receiving not recognized as an internal or external command, operable program or batch file
I tried withEnv('MSBuild 17') { ... }
which didn't work either.
Does anyone have a hint how to fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是如何使用MSBUILD工具的一个示例:
就我而言,MSBuildTools16 => “ C:\ Program Files(X86)\ Microsoft Visual Studio \ 2019 \ BuildTools \ MSBUILD \ MSBUILD \ Current \ bin \ msbuild.exe”
另一个解决方案:
Here is an example of how to use the MSBuild tool:
And in my case, MSBuildTools16 => "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MsBuild.exe"
Another solution:
假设安装了 jenkins msbuild插件,只有父母 bin 其中指定的文件夹路径:
://issues.jenkins.io/browse/jenkins-56389“ rel =“ nofollow noreferrer”>问题56389 用于插图:
That supposed having installed the Jenkins MSBuild plugin, with only the parent
Bin
folder path specified in it:See issue 56389 for illustration: