Unable to scan using .NET scanner

Unable to scan .NET application using sonar scanner (sonarscanner.msbuild.exe version 4.6.1+)

I had to use the .NET framework scanner, since this application includes ASP code files.
I ran the scanner begin pre-processing (successful)
ran the build (successful, with warnings - MSBUILD version 15.6.82.30579)
SonarScanner for MSBuild 5.2.2

None of the below items apply.
1.The scanner was run with begin, build, end steps.
2. The version of MSBuild was 15.6.82.30579
3. it was all run from the same folder.
4.There is a GUID in the .sln folder for the project. I am not sure how to verify its validity, but here it is:
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = “CMS”, “CMS”, “{420F4FED-2F28-4BE5-8CEA-9A6B9A57558B}”

…Here is the log snippet:
Using the .NET Framework version of the Scanner for MSBuild
Post-processing started.
13:31:09.154 The SonarScanner for 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.25420.1 and higher 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)
    13:31:09.157 Generation of the sonar-properties file failed. Unable to complete the analysis.
    13:31:09.174 Post-processing failed. Exit code: 1

Any help would be greatly appreciated. I am able to scan it in using the CLI but that does not support C#. if it matters, this is commercial version on a dedicated server on a different machine. Configuration is valid, since I am able to scan using CLI.

Hi @joeguerra - welcome to the community!

You’re using quite an old version of the Scanner for .NET. Does it work with the latest version? (currently v.5.2).

What type of project are you analysing? The scanner can analyse ASP.NET projects, but legacy “Web Site” projects are not supported.

I suspect we are dealing with a legacy “Web Site” project. We are using a CMS that apparently has at least some components that are using legacy ASP.NET and I do not have a .csproj file. Does that mean we cannot use sonarQube at all for this project ? Is there some workaround or mechanism by which we could convert the project infrastructure without breaking the sites?

However, I thought I was dealing with the most recent scanner for .NET. I suspect I mistakenly assumed I had to use the older .NET 4.6 scanner in order to scan a .NET 4.6 site. I will go ahead and try with the .NET 5.x scanner and see if that helps, though I am not confident, based on the possibility this is simply an unsupported architecture.

Thanks for the response!

No problem. If there isn’t a project file, then it’s a legacy web site project and isn’t supported, I’m afraid.