SonarQube 7.9 ignore aspx.cs and Unable to required information

SonarQube 7.9
Scanner for MSBuild 4.6.2

I tried to run the scanner for an asp.net project the Build is successful however when I run the “end” part I got this error.

SonarScanner for MSBuild 4.6.2
Using the .NET Framework version of the Scanner for MSBuild
Post-processing started.
The SonarQube MSBuild integration failed: SonarQube was unable to collect the required information about your projects.
Possible causes:
  1. The project has not been built - the project must be built in between the begin and end steps
  2. An unsupported version of MSBuild has been used to build the project. Currently MSBuild 14.0 and 15.0 are supported
  3. The begin, build and end steps have not all been launched from the same folder
  4. None of the analyzed projects have a valid ProjectGuid and you have not used a solution (.sln)
Generation of the sonar-properties file failed. Unable to complete SonarQube analysis.
13:14:03.204  Post-processing failed. Exit code: 1

The commands that I use:

SonarScanner.MSBuild.exe begin /k:"CSTESTING" /d:sonar.host.url="http://host-url" /d:sonar.login="token" /d:sonar.verbose=true

 MsBuild.exe .\ExchangeWSV2.sln /t:Rebuild /v:diag

 SonarScanner.MSBuild.exe end /d:sonar.login="token"

Here the complete logs
begin_command.txt (6.6 KB)
MS_BUILD.txt (67.6 KB)
end_output_error.txt (3.0 KB)

Thanks in advance

anyone ?

hi @archagy, welcome to the forum. What version of MSBuild are you using?

@Andrei_Epure Thanks for your response, I upload the log output of the commands but I tried with the MSBuild 14.023107.0 and with the 15.9.21.

With the both builds I got the same output error

The SonarQube MSBuild integration failed: SonarQube was unable to collect the required information about your projects.
Possible causes:

If I use dotnet I got a different error

ExchangeWSV2.sln : Solution file error MSB4249: Unable to build website project “ExchangeWS”. The ASP.NET compiler is only available on the .NET Framework version of MSBuild.

Bump :slight_smile:

hey @archagy - please let me know if:

  • are you running are 3 commands from the same folder?
  • what are the contents of the .sonarqube\out folder?
  • could you please share the .sonarqube\conf\SonarQubeAnalysisConfig.xml and the .sonarqube\conf\sonar-project.properties
  • are you running are 3 commands from the same folder?

Yes

  • what are the contents of the .sonarqube\out folder?

The folder is Empty

  • could you please share the .sonarqube\conf\SonarQubeAnalysisConfig.xml and the .sonarqube\conf\sonar-project.properties

SonarQubeAnalysisConfig.txt (11.2 KB)

There is no sonar-project.properties.

bump :slight_smile:

Hi @archagy,

Looking at the build output, it looks like there aren’t any .csproj or .vbproj files in the solution configuration that you are building.

The only ProjectConfiguration that is listed is pointing at a folder rather than a project:

<SolutionConfiguration>
  <ProjectConfiguration Project="{DAE7EE1B-2A50-4708}" AbsolutePath="C:\Users\myUser\projects\company\exchangesm\ExchangeWS\" BuildProjectInSolution="True">Debug|AnyCPU</ProjectConfiguration>
</SolutionConfiguration>

What kind of web application are you building, and does it have a .csproj or .vbproj file? (I’m guessing it’s a web application from the references to the aspnet compiler in the build output).

Thanks.

Hi @duncanp, sorry for the long wait. Yes it’s an aspnet project web application using dotnet framework 4.0. There is no csproj only the solution file.

Here is my solution filesolution.txt (1.8 KB)

@Andrei_Epure @duncanp

In a quick search on google, I found this previous comment on other post.

I guess it is the same scenario for this case, am I right ?

bump :slight_smile:

Yes, it’s the same scenario. Looking at your build output again, I can see it’s calling aspnet_compiler.exe.