ReSharper error when executing SonarQube analysis from TFS 2013 build - tfs

I have been setting up SonarQube analysis from a TFS 2013 build using the instructions made by Microsoft ALM Rangers:
https://vsarguidance.codeplex.com/downloads/get/1452516
It all Works fine, until I add ReSharper analysis, then i get an error;
09:51:49: ERROR: Error during Sonar runner execution
09:51:49: ERROR: Unable to execute Sonar
09:51:49: ERROR: Caused by: The property "sonar.resharper.cs.reportPath" must be set.
I have added a sonar-project.properties file to TFS in the same directory as my solution file.
The file looks like:
sonar.resharper.projectName=CommonComponents
sonar.resharper.cs.reportPath=resharperresults.xml
Im using SonarQube 5.1 and the R# 2.0 plugin
Running analysis from Jenkins Works fine.
I really hope you can help me out of this. Im pretty sure its something stupid that I just can't turn my eyes around to see.

The support of the R# by the MSBuild Runner is only going to become available in the version 1.0 of the MSBuild Runner & 2.0 of the R#. See the following tickets:
http://jira.sonarsource.com/browse/SONARMSBRU-16
http://jira.sonarsource.com/browse/SONARRSHPR-15

Related

TFS 2015 No agent can be found with following capabilities: msbuild, java, sonar qube

I've succeeded build with TFS 2015 Using MSbuild task. Now I've added Sonar qube tasks (SonarQube for MSBuild - Begin Analysis & End Analysis), find the Sonarqube settings below:
1. What is the Project key & how do we get it? I just gave Project Name as key.
Immediately on build trigger threw error/warning:
There are issues with the request or definition that may prevent the
build from running:No agent could be found with the following
capabilities: msbuild, java, msbuild, java. Queue the build anyway?
On Trigger Build further, Build failed with following error
No agent found in pool which satisfies the specified demands:
msbuild
java
msbuild
msbuild java Agent.Version -gtVersion 1.94.0
On cross-checking, i see that under General section in Build definition : Demand for MSBuild & java exists.
2. Am i correct or missing anything/settings?
I've configured Service Endpoint for SonarQube also. Find the screen shot below:
Please suggest on my error & queries highlighted.
When adding new task which required agent capabilities you need to add it to the agent.
The capabilities must be installed on the build servers where the agents are located.
UPDATE:
I just installed sonar qube on my test environment.
I got the same exception as you did, fixed it by installing java and msbuild .
Check,if those capabilities exists under your agent :

Sonarqube build for UWP-App failed

I habe a TFS-Server-Build (TFS 2017) on a Build-Agent with VS 2017. The first Buildstep (Prepare the Sonarqube analysis) and the build of the solution works fine. But i have a error at "Complete the SonarQube analysis":
2017-05-29T03:06:09.1933915Z ##[error]The SonarQube MSBuild integration failed: SonarQube was unable to collect the required information about your projects.
2017-05-29T03:06:09.1933915Z ##[error]Possible causes:
2017-05-29T03:06:09.1933915Z ##[error]1. The project has not been built - the project must be built in between the begin and end steps
2017-05-29T03:06:09.1933915Z ##[error]2. An unsupported version of MSBuild has been used to build the project. Currently MSBuild 12.0 upwards are supported
2017-05-29T03:06:09.1933915Z ##[error]3. The begin, build or end steps have not all been launched from the same folder
2017-05-29T03:06:09.1933915Z Generation of the sonar-properties file failed. Unable to complete SonarQube analysis.
2017-05-29T03:06:09.1933915Z ##[error]05:06:09.115 Post-processing failed. Exit code: 1
Can anyone help?
Kind regards
Sebastian
I am not familiar with TFS-Server-Build,, but the possible causes are mentioned.
Check the following link for more details on how to set it up properly
Just like the error mentioned this stands for SonarQube was unable to collect the required information about your projects
Even though you have installed MSBUILD 12 or above, you should make sure the Build agent is calling the right version.
And double check if the MSBuild.SonarQube.Runner and MSBuild is running from the same working directory. At .sonarqube/out folder the sonar-project.properties is getting created or not.

VS2015 build with TFS2013

I'm trying to do a teambuild for a VS2015 solution with TFS2013.
On the buildserver VS2015 is installed and I changed the buildtemplate so msbuild has an argument \tv:14.0, but when a start a build I get the following error:
C:\Program Files
(x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets (96):
Invalid static method invocation syntax:
"[Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformSDKDisplayName($(TargetPlatformIdentifier),
$(TargetPlatformVersion))". Method
'Microsoft.Build.Utilities.ToolLocationHelper.GetPlatformSDKDisplayName'
not found. Static method invocation should be of the form:
$([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine(a,
b)).
The buildserver has been restarted but I still get the error.
I also checked this thread: Build failed in TFS but no real answer was given there. Is there anyone that knows how to solve this.
I was experiencing the exact same error. I determined that TFS2013 was the RTM version so we installed TFS2013 Update 5. Now if I run using the *.12.xaml process template with the /tv:14.0 /p:VisualStudioVersion=14.0 parameters the build succeeds. I have also made a copy of the *.12.xaml build process and named it *.14.xaml and changed the Run MSBuild steps ToolVersion property to "14.0" and this build works as well, without the parameters.
You need to customize the build process template by finding all the Run MSBuild for Project MSBuild activity, then set the ToolVersion to "14.0" and set ToolPath to target to MSBuild14 (by default: "C:\Program Files (x86)\MSBuild\14.0\Bin"). After that, check in the build process template and re-queue the build.
Check the solutions here:TFS 2013 building .NET 4.6 / C# 6.0

Gallio not working with sonar-runner

I'm trying to get sonar-runner to run Gallio and OpenCover on my .net application.
I've set up the following:
Sonarqube v4.3.2
Gallio v3.4.14
NUnit v2.6.3
OpenCover v4.5
Sonar-runner v2.4
Here is what I have in my sonar-project.properties file (the things conserning Gallio)
\#Gallio
sonar.gallio.mode=
sonar.gallio.coverage.tool=OpenCover
sonar.donet.visualstudio.testProjectPattern=*Test*
sonar.opencover.installDirectory=C:\\Program Files (x86)\\OpenCover\\
sonar.dotnet.test.assemblies=**\\bin\\Debug\\*.Tests.dll
sonar.gallio.runner=Local
I have tried all sorts of variations of this config file but the weird thing is that when I run sonar-runner, even with parameters -X or -e, there is absolutely no mention of Gallio or OpenCover in the output. It's like the sonar runner is just skipping the Gallio section completely!
Does anyone here have a clue of what might be going on ?
Latest versions of the C# Plugin do not support the automatic execution of Gallio (see this documentation).
Starting with C# 3.0, only the reuse of reports is supported to get test and coverage information for .NET projects. Please read the documentation page of the C# plugin to know how to do that.

MSTest crash during a build in TFS 2008 SP1

I've never managed to make MsTest works during the build of my solution on TFS. When I look the build log, I see this that TFS want to execute MsTest :
"C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\MSTest.exe" /nologo /searchpathroot:"C:\BinaryRoot\TFSBuild" /resultsfileroot:"C:\TestResults\" /testmetadata:"C:\Build\MySolution\Full.vsmdi" /testlist:"WorkingTest" ...
But the build don't create any test result file.
I tried to launch this line manually on the build server but MsTest crash after this :
Loading C:\Build\MySolution\Full.vsmdi...
Search path(s) for tests:
C:\Build\MySolution\Binaries\TFSBuild
C:\Build\MySolution
Search path(s) for default run configuration:
C:\Build\MySolution
I don't see any problem with the path, my file testrunconfig is under C:\Build\MySolution.
My tests can run on my machine (VS 2008 vsts).
I've got the same problem with another build machine.
The event viewer, shows me two errors :
NET Runtime version 2.0.50727.3082 -
Fatal Execution Engine Error
(7A035FC0) (80131506)
and
Faulting application mstest.exe, version 9.0.30729.1, stamp 488f21a6, faulting module mscorwks.dll, version 2.0.50727.3082, stamp 492b82c1, debug? 0, fault address 0x001c5fc0.
Does someone has an idea about this issue, or should I just switch to another test framework/CI server ? :(
I have the exact same problem with Hudson CI, so I don't think this is related to your CI server.
Still searching for a solution though...
There is a hotfix for the same error signature, different conditions but it could be the same underlying cause - give this a try.

Resources