Asp.net project website is ignored during the analyse

hello,

I’m wondring if it’s a version compatibility between sonar 7.6 and .Net Framework 2.0, but in my solution (based on vb.net) there is 2 projects : a library project and a WebForm asp.net website.

when I folow steps to analyse the solution :
1-SonarScanner.MSBuild.exe begin /k:“xxxx” /d:sonar.host.url=“http://localhost:9000” /d:sonar.login=“cc7f777fdcef930b5f976338b3a3fc639b92ed74”
2-MsBuild.exe /t:Rebuild
3-SonarScanner.MSBuild.exe end /d:sonar.login=“cc7f777fdcef930b5f976338b3a3fc639b92ed74”

I found that the result doens’t take into consideration the website code source, even in the “code” tab there only the library project wich is listed as a project of the solution analysed !!

Any help please ? How can I analyse my old projects, supposing that there is no migration planned in the near futur ?

Thanks

Is the project of type Web Site or Web Application? The Web Site projects (e.g. those that have no project file) are not supported. I don’t know the exact reason for that, but I suspect that it is because the Web Site projects are not compiled, the actual compilation happens on the web server when the site is launched. Since our analyzers are basically plugins for the compiler, there is no compilation to execute them…

Not sure what could you do about such projects except upgrading, one option is to try to extract as much of the code into a separate ClassLibrary project for example, so that it could be analyzable.

I guess you are already using a newer version of MSBuild to build your projects (otherwise it would be surprising if they appeared in SonarQube), but I just want to remind you that the only supported versions of MSBuild are 14 and newer (including 14) - in other words, those that come with VS2015 and newer.

Hello,
Many thanks for your quick reply, it’s clear now that we have to put our hands on the code if we want to use sonar :slight_smile:
For your questions please find answers bellow:
1- Is the project of type Web Site or Web Application? ==> yes it’s a website with no project file.
2- I guess you are already using a newer version of MSBuild to build your projects ==> yes indeed, we are using MSBuild14 (VS2015).