Appcenter iOS build fails when enabling sonarscanner - xamarin.ios

For an appcenter deployment I want to use SonarQube to analyze the code quality of the project. I have setup the appcenter-pre-build.sh and appcenter-post-build.sh scripts to install and enable Sonarscanner in the appcenter build process.
Now when I build for iOS, the build process fails, because it cannot find 2 files in the /Users/runner/work/1/.sonarqube folder on the build machine. Those files are /Users/runner/work/1/.sonarqube/conf/cs/SonarLint.xml and /Users/runner/work/1/.sonarqube/conf/4/ProjectOutFolderPath.txt.
I know for a fact that the /Users/runner/work/1/.sonarqube/conf/cs/SonarLint.xml is there, because in the logfile it says: "Writing Roslyn analyzer additional file to /Users/runner/work/1/.sonarqube/conf/cs/SonarLint.xml..." when running the appcenter-pre-build.sh script, which installs the sonarscanner.
I am installing the sonarscanner with the command: dotnet tool install --global dotnet-sonarscanner and the version that gets installed is 5.0.4.
On my SonarQube server I am running version 8.3 community edition and when the appcenter build runs, the analysis report appears in my project on my sonarqube server.
The build however fails.
Please advice on how to get the iOS builds in appcenter to succeed while sonarscanner is enabled.
Thank you in advance.

The problem is how appcenter logs the build process. From going through the logfiles, you get the impression that the build fails, because of the integration with Sonarqube.
The build failed however, because there were some context links missing in the c# code. Once this issue was found by building locally, The builds succeeded.

Related

VS AppCenter - XCUI - Getting Failed to analyze MachO file error

I am creating an azure Devops pipeline for UI testing my iOS application.
I have built my project and feeding my ipa to Visual Studio AppCenter Test pipeline, I was getting the error,
Error: Failed to analyze MachO file: Unknown load command: 2147483700
I tried to run my code manually using appcenter-cli from terminal and still getting the same error. I saw this issue in GitHub and not sure how to do this workaround in devops pipeline.
Am I missing something here? Can no-one use AppCenter CLI because of this issue?
You have to build your app with xcode 11 and than it works. But this is just a workaround. Hopefully they will fix it in the near future.

msbuild.exe does not run on Linux VM in Azure

I am trying to use Jenkins to run my unittests. I have made a Jenkins Project for a build with a buildstep "Build a Visual Studio Project using MSBuild". My Jenkins server is installed on a linux vm which is in Azure.
You can see it here in the Jenkins UI:
When I run the build I get this Console Output:
Path To MSBuild.exe: msbuild.exe
FATAL: Unable to use this plugin on this kind of operation system
Executing the command msbuild.exe /ContinuousIntegration/ContinuousIntegration.sln from
/var/lib/jenkins/workspace/CSHARP_CI_TEST - UNITTEST
[CSHARP_CI_TEST - UNITTEST] $ msbuild.exe
/ContinuousIntegration/ContinuousIntegration.sln
Build step 'Build a Visual Studio project or solution using MSBuild' changed
build result to FAILURE
Build step 'Build a Visual Studio project or solution using MSBuild' marked
build as failure
Finished: FAILURE
I think the problem here is that I am trying to use msbuild.exe on a Linux VM. Is there a workaround for this or is it not possible to do this?
I have tried to use the msbuild.exe on the vm via a linux terminal, but it is not possible to run it.
To accomplish your requirement you have to install '.NET Core SDK' in the Azure Jenkins Linux VM and then you may simply use 'Execute shell' build step with the command 'dotnet build ContinuousIntegration/ContinuousIntegration.sln'
To install '.NET Core SDK' in your Azure Jenkins Linux VM, please go to https://dotnet.microsoft.com/learn/dotnet/hello-world-tutorial/install and click on 'Linux' in that page and then select the required Linux distribution and follow the steps provided.
For more information on MSBuild support on various operating systems, please refer https://github.com/Microsoft/msbuild/blob/master/documentation/wiki/Building-Testing-and-Debugging-on-.Net-Core-MSBuild.md
Just FYI, I have tested and reproduced your scenario and faced the same error which you have mentioned and then I have followed the above process and resolved the issue successfully. So I hope this helps. Cheers!!
PS: in your shell script you have to cd to the right folder for this to work.

TeamCity Build Agent (v27767) deletes MsBuild.exe on run

TeamCity 8.0.6 CI box with build agent has been purring along for several years. After a system restart, TeamCity seems to have auto-upgraded the local build agent to version 27767. No other configuration changes were made, but this error now shows on build trigger:
Unable to find MSBuild at C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe, please check MSBuild environment variable to target to Microsoft .NET Framework 2.0/3.5/4.0 or Mono installation directory
I RDP'd into the box and see that MSBuild.exe went missing - strange. So I re-add it from a local install and retrigger a build. As soon as the build agent picks up the file, it disappears! Happens every time. Maybe Windows is protecting this folder?
The build agent then becomes "incompatible". I tried this workaround, but this doesn't stop msbuild.exe from being deleted.
I checked that there are no odd steps in my build configuration. What could be deleting or moving MSBuild?

publish and deploying .net core application to linux

Im having truble with publish and deploying a .net core web-api on a ubuntu 16.04 desktop ran in vmware. I have developed a simple web-api application with almost no extra implementation from the template v1.1. I have been installing and using some dependencies that are runnable in .net core.
Problem:
Im using framework dependent release v1.1.
I can launch a released version on windows by using "dotnet publish -c release" and it works fine. I then move the published files to my ubuntu machine and tries to run it I get the error that it cannot locate some kind of assembly that I know is in the dll folder.
However if I move the source code and project to my ubuntu machine and do a "dotnet restore" and "dotnet publish -c release" the application works. If I dont use the "dotnet restore" and tries to publish on my ubuntu machine it gets another "are you missing an assembly reference".
My guess is that when I do "dotnet publish -c release" it targets runtimes only for windows or ubuntu depending on the machine publishing.
Im grateful for help and explanation for this.
Sorry for bad language.
Stupid me have been running the wrong application dll. I always ran the application dll in the folder netcoreapp1.1 when I should have ran the same dll in the sub directory publish.

I am trying to build a msbuild project for xbuild but it keeps failing

I have a vb.net project that i would like to build using travis ci but travis only runs on linux so I have to use xbuild. I have the build log here. Can anybody tell me why the build is failing with this error?
Error executing tool '/usr/bin/vbnc': ApplicationName='/usr/bin/vbnc', CommandLine='/noconfig #/tmp/tmp3b9f993d.tmp', CurrentDirectory='/home/travis/build/RX14/SWRChart/src'
The full build log is available here and the source is available here
It Seems that mono doesn't seem to support WPF so this is pointless. Oops.

Resources