I have created a pipeline in Jenkins like that:
pipeline {
agent any
stages {
stage('Clean') {
steps {
cleanWs()
}
}
stage('Checkout code') {
steps {
git branch: 'test', credentialsId: <credentialsId>, url: <githubUrl>
}
}
stage('Restore Nuget') {
steps {
bat '"C:\\Nuget\\nuget.exe" restore <ProjectName>.sln'
}
}
stage('Build') {
steps {
bat "\"${tool 'MSBuild'}\" <ProjectName>.sln /p:Configuration=Release;Platform=\"Any CPU\""
}
}
}
}
I have installed MSBuild plugin in Jenkins. In "Global Tool Configuration", I added msbuild path like that: C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe
In the build stage I am getting this error :
MSBUILD : error MSB1009: Project file does not exist.
When I check Jenkins workspace folder, I can see all project files (.sln and .csproj files). What am I doing wrong?