Build step failing for TeamCity and Team Foundation Server 2012 - c#

Updated with images.
When setting up a project in TeamCity, I cannot get the build step to work. I get the same
error every time.
Failed to start MSBuild.exe. Failed to find project file at path: C:\TeamCity\buildAgent\work\42c94c0380966ffa\Main\Solution.sln
I am able to connect to the TFS. Where I put the root as following.
$/Projectname/
Testing the connection returns ok.
When creating the build step I use MSBuild and set the Build file path to where the solution exists in the tfs structure. So for example.
Build file path: Main\MySolution.sln
Because in the TFS this is where the solution is. $/Projectname/Main/MySolution.sln. When I run the build step I get the error above. What am I doing wrong? The 42c94c0380966ffa folder is created on disc but it is empty.
LOG
[14:55:24]Checking for changes
[14:55:25]Publishing internal artifacts
[14:55:25][Publishing internal artifacts] Sending build.start.properties.gz file
[14:55:25]Clearing temporary directory: C:\TeamCity\buildAgent\temp\buildTmp
[14:55:25]Checkout directory: C:\TeamCity\buildAgent\work\42c94c0380966ffa
[14:55:25]Updating sources: server side checkout
[14:55:25][Updating sources] Will perform clean checkout. Reason: Checkout directory is empty or doesn't exist
[14:55:25][Updating sources] Transferring cached clean patch for VCS root: EEL TFS
[14:55:25][Updating sources] Repository sources transferred
[14:55:25][Updating sources] Removing C:\TeamCity\buildAgent\work\42c94c0380966ffa
[14:55:25][Updating sources] Updating C:\TeamCity\buildAgent\work\42c94c0380966ffa
[14:55:25]Step 1/1: Build Solution (MSBuild) (2s)
[14:55:25][Step 1/1] Starting: C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.MsBuildBootstrap.exe /workdir:C:\TeamCity\buildAgent\work\42c94c0380966ffa /msbuildPath:C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
[14:55:25][Step 1/1] in directory: C:\TeamCity\buildAgent\work\42c94c0380966ffa
[14:55:28][Step 1/1] Failed to start MSBuild.exe. Failed to find project file at path: C:\TeamCity\buildAgent\work\42c94c0380966ffa\Main\MySolution.sln
[14:55:28][Step 1/1] Process exited with code -42
[14:55:28][Step 1/1] Step Build Solution (MSBuild) failed
[14:55:28]Publishing internal artifacts
[14:55:28][Publishing internal artifacts] Sending build.finish.properties.gz file
[14:55:28]Build finished
My VCS root configuration, username and password removed.
And where the solution is located.
And the build step
Version control settings
General settings

It looks like you've configured your build to look for MySolution.sln but in TFS it's actually called EEL B2C.sln.

Related

Failing to codesign "no such file or directory" on distribution

I've been stuck all day trying to get a Xamarin.iOS mobile application to distribute after archive.
The archive process runs smoothly, then when we attempt to distribute via Ad Hoc, it fails with a message complaining about a missing file.
The error is as follows:
Could not create ipa file for distribution of the archive '[redacted]'
/usr/bin/codesign exited with code 1
/usr/bin/codesign exited with code 1
Failed to codesign '.../Mobile.iOS/obj/iPhone/Debug/archives/Mobile.iOS 3-30-21 11.41 AM.xcarchive/Products/Applications/Mobile.iOS.app//**/*.dylib': [redacted]/Library/Caches/Xamarin/mtbs/builds/Mobile.iOS/17a75d5999f2d5c58a10f98135732a71be8d334fae491e1585d4d1f1bbfa6140/C:/Users/.../Mobile.iOS/obj/iPhone/Debug/archives/Mobile.iOS 3-30-21 11.41 AM.xcarchive/Products/Applications/Mobile.iOS.app//**/*.dylib: No such file or directory
Failed to codesign '.../Mobile.iOS/obj/iPhone/Debug/archives/Mobile.iOS 3-30-21 11.41 AM.xcarchive/Products/Applications/Mobile.iOS.app//**/*.metallib': [redacted]/Library/Caches/Xamarin/mtbs/builds/Mobile.iOS/17a75d5999f2d5c58a10f98135732a71be8d334fae491e1585d4d1f1bbfa6140/C:/Users/.../Mobile.iOS/obj/iPhone/Debug/archives/Mobile.iOS 3-30-21 11.41 AM.xcarchive/Products/Applications/Mobile.iOS.app//**/*.metallib: No such file or directory
I have shortened some file paths (...) and redacted some identifying information of our client.
To resolve this we have attempted to:
The usual clean & rebuild
Deleting /bin & /obj
Clearing provisioning profiles & redownloading
Deleting all build data/caches and the "iOS folder" from %LOCALAPPDATA%\Xamarin
Reinstalling visual studio
Deleting & redownloading the project files (which work on other machines)
Any help/pointers would be appreciated

Generation of the sonar-properties file failed. Unable to complete SonarQube analysis

Application Stack
Jenkins
.NET 4.7
SonarQube 7.4
Bitbucket (Source control)
VS 2015 Update 3
VsTest to execute UnitTest
Path of Msbuid in Global Tools Configuration is
C:\Program Files (x86)\MSBuild\14.0\Bin\Msbuild.exe
Also tried with C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Msbuild.exe
We have created sample project and configured all in one server.
We can see multiple kind of errors in log files like
Generation of the sonar-properties file failed. Unable to complete SonarQube analysis.
WARNING: File 'C:\Program Files (x86)\Jenkins\workspace\CICD\UnitTestProject1\Properties\AssemblyInfo.cs' is not located under the root directory 'C:\Program Files (x86)\Jenkins\workspace\CICD.sonarqube\out' and will not be analyzed
No analysable projects were found. SonarQube analysis will not be performed
This only comes when i use msbuild from "Program files" An instance of analyzer SonarAnalyzer.Rules.CSharp.FieldsShouldNotBePublic cannot be created from C:\Users\manish.joisar\AppData\Local\Temp.sonarqube\resources\0\SonarAnalyzer.CSharp.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=1.3.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies
I can see message with build succeeded.
I can also see successful test run message
Total tests: 1. Passed: 1. Failed: 0. Skipped: 0.
Test Run Successful.
Sonar configuration is done in build configuration under "Execute Sonar scanner" step
I am not sure what is missing here, wrong configuration, wrong msbuild ??
I suppose you have gone through this documentation https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+MSBuild for getting all the dependencies information and the command required to run the analysis.
I was getting some of the error mentioned above when i was trying to analyse c# files but i require more information to understand your case so please provide the o/p of each steps mentioned below:
SonarScanner.MSBuild.exe begin /k:"project-key"
MSBuild.exe <path to solution.sln> /t:Rebuild
SonarScanner.MSBuild.exe end
If you are running through jenkins MSBuild plugin, then please provide the verbose output of the same.
I solved all above issues with below configuration in Jenkins
SonarQube configuration
Jenkin Global tool configuration
Freestyle project configuration

No artifacts found that match the file pattern in jenkins configuraion

I have a .net class library and configuring that library to the Jenkins. I want to copy the new build dll to the bin directory of the my workplace (F:/Projects/Utility/bin/Release). I have mentioned the path of "Files to archive" to F:/Projects/Utility/bin/Release/*.dll. But as soon as I build through the Jenkins it shows the below error:
Archiving artifacts
ERROR: No artifacts found that match the file pattern "F:/Pankaj/Projects/MA/MA Code/Jenkins Code/MA/SEIManagedAccounts/SEI.ManagedAccounts.Utility/bin/Release/.dll". Configuration error?
ERROR: ‘F:/Projects/Utility/bin/Release/.dll’ doesn’t match anything: even ‘F:’ doesn’t exist
Build step 'Archive the artifacts' changed build result to FAILURE
Finished: FAILURE

Getting Microsoft's DocFX to work in Visual Studio

I downloaded DocFX and installed it from http://dotnet.github.io/docfx/.
I added it to my environment path. I then downloaded the sample solution from https://github.com/docascode/docfx-seed and opened it as a website project. (This sample already contains the package docfx.msbuild)
The documentation says to build the solution and then browse the _src folder for the website. I do this and the solution builds fine:
------ Build started: Project: docfx-seed-master, Configuration: Debug Any CPU ------ Validating Web Site Building directory
'/src/SampleClass1/BaseClass/obj/Debug/'. Building directory
'/src/SampleClass1/BaseClass/Properties/'. Building directory
'/src/SampleClass1/BaseClass/'. Building directory
'/src/SampleClass1/CatLibrary/obj/Debug/'. Building directory
'/src/SampleClass1/CatLibrary/Properties/'. Building directory
'/src/SampleClass1/CatLibrary/'. Building directory
'/src/SampleClass1/SomeVbClass/My Project/'. Building directory
'/src/SampleClass1/SomeVbClass/'.
Validation Complete
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
but there is no generated _src folder. If I however run docfx from the command line then I do indeed get a _src folder and I can browse the generated website.
So my integration of DocFX into VS2015 via MSBuild is somehow broken. Can anyone shed any light on how to get this working?

Git not found in path by SonarQube using Jenkins

My setup is as follows:
Jenkins on Windows Server 2012 system
Git installed on the same system
SonarQube on separate server, executed by SonarQube Runner (not Maven)
I have a Jenkins project that pulls source code (C#) using Git, compiles it, then presents it for analysis to SonarQube. The pull, compile, and analysis all work, but I am getting error messages saying:
16:05:58.883 INFO - Retrieve SCM info for (source file path)
16:05:58.883 WARN - Fail to retrieve SCM info of: (source file path) Reason: The git blame command failed. 'git' is not recognized as an internal or external command,
operable program or batch file.
I first assumed that Git had to be installed on the SonarQube server, too, but there is another project using a similar setup and the same SonarQube server that is working correctly, adding "blame" information to SonarQube's source code listings.
What am I missing?

Categories

Resources