- SonarQube: 220.127.116.11448
- TFS: 2017
We have set up a SonarQube server and we do use TFS build definition to actually create statistics for asp.net MVC projects. The statistics are fine so far: We do see stats for java script, xml, etc.
We do not see stats for C# files.
I expect this to be the reason: As far as I understand, the build step “Prepare Analysis Configuration” somehow hooks into msbuild.
Now we are not calling msbuild directly in the build step but run a small C# application from which we then run msbuild. This tool, amongst other things, determines the actual msbuild version to use.
In the end analysis step, I do see this output:
2019-11-06T01:15:57.5651686Z ##[error]The SonarQube MSBuild integration failed: SonarQube was unable to collect the required information about your projects.
- The project has not been built - the project must be built in between the begin and end steps
- An unsupported version of MSBuild has been used to build the project. Currently MSBuild 14.0.25420.1 and higher are supported.
- The begin, build and end steps have not all been launched from the same folder
- None of the analyzed projects have a valid ProjectGuid and you have not used a solution (.sln)
I assume that this “hooking” of yours somehow doesn’t work in that scenario.
My actual question is: What exactly do you do to hook into msbuild?
Once we understand this, we can find ways to use our tool for analysis as well.