No ProjectInfo.xml files were found .TFS build with sonar end task - tfs

I am trying to configure my visual studio project to send some analysis data to SonarQube server using TFS 2015 build (vnext)
I get this error in the Sonar end task.
##[error]No ProjectInfo.xml files were found. Possible causes:
##[error]1. The project has not been built - the end step was called right after the begin step, without a build step in between
An unsupported version of MSBuild has been used to build the project. Currently MSBuild 12.0 upwards are supported
We use MSBuild 14.0 in the server.

The SonarQube Scanner for MSBuild requires your project to be built
with MSBuild 14.0. We recommend installing Visual Studio 2015 on the
analysis machine in order to benefit from the integration and features
provided with the Visual Studio ecosystem (VSTest, MSTest unit tests,
etc.).
Suggest you to also install VS2015 on your build server, and since you are using MSbuild 14.0, double check if you are using the old task with deprecated in front which used for MSbuild 12.0. SonarQube Scanner for MSBuild released with static analysis which could executed during the build on MSbuild 14.0.
The support of MSBuild 12 by the SonarQube Scanner for MSBuild is
deprecated and will be removed in a future release.
Source: Compatibility with Visual Studio and MSBuild
Please download and use the latest version of the SonarQube Scanner for MSBuild in marketplace and try again. The recent documentation is available from Analyzing with SonarQube Extension for VSTS/TFS, you could also take a look at this tutorial.

Related

No coveragexml files in Scanner for MSBuild through VSTS extension

Using:
TFS 2017 Update-2
VS2015
VSTS Task 3.2.0
SonarQube 5.6.6 LTS
After the upgrade of the SonarQube Extension from 4.0.2 to 4.1 We get a warning when running the "Scanner for MSBuild - End Analysis" task.
We noticed that the codecoverage.xml files are not generated by the Code Coverage Tool (see logging below).
This only appears for TFS agents with VS2015 installed, it works fine for the same setup with VS2017.
We applied the work-around: SonarQube Code Coverage from VSTS
we put /d:sonar.cs.vscoveragexml.reportsPaths=**/*.coveragexml in the additional setting of the task "Scanner for MSBuild - Begin Analysis"
But stil no codecoverage.xmlfiles are produced
Is there another workaround or solution ?
2018-03-21T10:01:20.7772938Z ##[section]Starting: Complete the SonarQube analysis
2018-03-21T10:01:20.7929236Z ==============================================================================
2018-03-21T10:01:20.7929236Z Task : Scanner for MSBuild - End Analysis
2018-03-21T10:01:20.7929236Z Description : [DEPRECATED] Use new version of the task
2018-03-21T10:01:20.7929236Z Version : 3.2.0
2018-03-21T10:01:20.7929236Z Author : SonarSource
2018-03-21T10:01:20.7929236Z Help : [More Information](http://redirect.sonarsource.com/doc/install-configure-scanner-tfs-ts.html)
2018-03-21T10:01:20.7929236Z ==============================================================================
2018-03-21T10:01:20.7929236Z Preparing task execution handler.
2018-03-21T10:01:21.1835551Z Executing the powershell script: C:\TFS\Agent\_work\_tasks\SonarQubeScannerMsBuildEnd_6d01813a-9589-4b15-8491-8164aeb38055\3.2.0\SonarQubePostTest.ps1
2018-03-21T10:01:22.3867151Z WARNING: ------------------------------------------------------------------------
2018-03-21T10:01:22.3867151Z This executable is deprecated and may be removed in next major version of the SonarScanner for MSBuild. Please use 'SonarScanner.MSBuild.exe' instead.
2018-03-21T10:01:22.3867151Z ------------------------------------------------------------------------
2018-03-21T10:01:22.3867151Z SonarScanner for MSBuild 4.1
2018-03-21T10:01:22.3867151Z Using the .NET Framework version of the Scanner for MSBuild
2018-03-21T10:01:22.3867151Z Default properties file was found at C:\TFS\Agent\_work\_tasks\SonarQubeScannerMsBuildBegin_15b84ca1-b62f-4a2a-a403-89b77a063157\3.2.0\SonarQubeScannerMsBuild\SonarQube.Analysis.xml
2018-03-21T10:01:22.3867151Z Loading analysis properties from C:\TFS\Agent\_work\_tasks\SonarQubeScannerMsBuildBegin_15b84ca1-b62f-4a2a-a403-89b77a063157\3.2.0\SonarQubeScannerMsBuild\SonarQube.Analysis.xml
2018-03-21T10:01:22.3867151Z Post-processing started.
2018-03-21T10:01:22.3867151Z 11:01:21.761 11:01:21.746 WARNING: Failed to find the code coverage command line tool. Possible cause: Visual Studio is not installed, or the installed version does not support code coverage.
This issue is being tracked in #461 Failure to find VS2015 CodeCoverage.exe after searching for nonexistent registry key which lists the known workarounds (namely, manually add a registry key, or use VS2017 to build).
It should also work if the build agents have both VS2015 and VS2017 installed - the build can be performed using VS2015, but scanner end step should detect and use the VS2017 version of the code coverage tool.

MSBuild DeploymentModel unrecognised error in deploying SSIS package

I created a PowerShell script to automate deployment for SSIS projects and used it in a custom TFS task. Within this task I used a msbuild step to build the SSIS project which keeps failing with this error:
Error MSB4067: The element DeploymentModel beneath element Project
is unrecognized.
I built the SSIS projects in visual studio 2015 just fine. I have tried msbuild version 12.0 and 15.0 and they both have the same error.
Thank you
When you build your SSIS projects via VS, actually is calling /Build (devenv.exe), not directly using MSBuild.
There is no build-in task that supports building via devenv.exe.Still in the backlog. More details please refer: "Visual Studio Build" build step that actually invokes devenv.com instead of msbuild?
As a workaround, you could try to use 3-party extension task SSIS Build & Deploy for now.

No ProjectInfo.xml files were found Sonar scan

I am trying to configure my visual studio project to send some scan data to SonarQube server using TFS 2015 build (vnext)
I get this error in the Sonar end task.
##[error]No ProjectInfo.xml files were found. Possible causes:
##[error]1. The project has not been built
The end step was called right after the begin step, without a build step in between an unsupported version of MSBuild has been used to build the project. Currently MSBuild 12.0 upwards are supported.
We use MSBuild 14.0 in the server. it is a C++ project (VCXPROJ project File)

SonarQube MSBuild scanner: How to fix MSBuild 12 / sonar-runner deprecation message

We are using Visual Studio 2015 (original release, no update) with SonarQube and Jenkins, and keep getting the message:
WARN - * The use of MSBuild 12 or the sonar-runner to analyze C# projects is DEPRECATED *
However, we are using MSBuild 14, SonarLint, and the SonarQube scanner for MSBuild. This is confirmed at the beginning of the log:
SonarQube Scanner for MSBuild Begin Step 2.0
Loading analysis properties from c:\Program Files (x86)\tools\MSBuild.SonarQube.Runner-2.1\SonarQube.Analysis.xml
15:25:15.073 Updating build integration targets...
15:25:15.079 Fetching analysis configuration settings...
15:25:15.51 Generating rulesets...
15:25:16.629 Provisioning analyzer assemblies...
15:25:16.63 Installing required Roslyn analyzers...
SonarQube Server is 5.1.2
We used the instructions at http://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+MSBuild#AnalyzingwithSonarQubeScannerforMSBuild-msbuildcompat and the Jenkins integration
http://docs.sonarqube.org/display/SCAN/From+Jenkins
I found the question SonarQube warning on MSBuild version but I think we are correctly using SonarLint. What is the cause of the deprecation message?
We finally solved this issue by updating everything: We updated the C# plugin in Sonarqube and all Jenkins Plugins (including the msbuild plugin). After that, the deprecation message no longer occurs.

TFS 2010 issues building C#6.0 code with MS Build 14

We have TFS 2010 running happily on a dedicated build server.
I have installed Microsoft Build Tools 2015, which includes MS Build 14 successfully on the build machine, but not Visual Studio 2015.
I've created a custom template which alters the "ToolsPath" property of the "Run MSBuild" activity to "C:\Program Files (x86)\MSBuild\14.0\Bin".
The build runs, but fails on this particular error:
(CoreCompile target) ->
CSC : error CS1566: Error reading resource 'ProjectName.exe.licenses' --
'Could not find file 'C:\develop\Sources\ProjectName\obj\x86\Release\ProjectName.exe.licenses'.' [C:\develop\Sources\ProjectName\ProjectName.csproj]
The same project builds fine using Visual Studio 2015 running from another machine.
It makes no difference whether the TFS build definition includes these MS Build arguments or not:
/tv:14.0 /p:VisualStudioVersion=14.0
Does anybody have a success story of using a TFS 2010 build agent to successfully build a C#6.0 project?
I solved this in the end by installing Visual Studio 2015!
The /tv:14.0 /p:VisualStudioVersion=14.0 argument may don't work for MSBuild Tools.
You should customize the tfs build process template to set ToolPath of the Run MSBuild for Project to target to MSBuild14; and set ToolVersion to "14.0".
Check this link for the detailed information:BuildActivity ignores ToolsVersion

Resources