Quantcast
Channel: MSBuild forum
Viewing all articles
Browse latest Browse all 2763

Issue with Building Solution in an SVN Branch of Multibranch Jenkins Pipeline

$
0
0

I have a .Net Standard 2.0 solution. The solution is in a folder and the project file is in a sub folder. It has just one class file and a simple method Add which adds 2 numbers and returns the result.

I have the same project and the solution under Trunk and a couple of SVN Branches. (1.0.0.0 and 2.0.0.0). I am trying to setup a Multibranch Pipeline in Jenkins. For each branch, there is a Jenkinsfile and when I scan Jenkins, it automatically creates a new job for every branch. So far good. Now, when I try to build the solution from Jenkinsfile, it keeps failing. For branches, Jenkins creates a folder structure for the workspace like Job_Name\branches%2FMyFolder%2F1.0.0.0. Within this folder it downloads the source code. To rule out Jenkins issues, I logged into the Build server directly, opened PS as Admin and navigated to this directory which has .sln file and when I run "dotnet restore", I get the error that the project file was not found. Also, it is looking for the project file in a different directory. I tried to check the solution file, but it has only relative path. I am not sure where it is looking for the absolute path. However, if I run dotnet restore <Path_Of_Project_File>, it runs. 

Then when I run msbuild MySolution.sln (msbuild TestClassLib.sln -verbosity:m -restore -t:clean,build /p:Configuration=Release /p:WarningLevel=0 /p:DebugSymbols=false /p:DebugType=none /p:RestoreForce=true), it fails with the following errors.  

AssemblyInfo.cs(18,12): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?

TestClassLib.AssemblyInfo.cs(14,55): error CS0518: Predefined type 'System.String' is not defined or imported 

Can anyone please help?


Ven


Viewing all articles
Browse latest Browse all 2763

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>