I was unable to analyze DotNet project (SonarQube 7.3)

sonarqube

(Suman Kar) #1

I have already analyzed JAVA,PHP,PYTHON project successfully but when i am trying to analyze .net project getting error.I am using SonarQube 7.3

------------------Log-----------------
Microsoft Windows [Version 10.0.16299.665]
© 2017 Microsoft Corporation. All rights reserved.

C:\Users\RUDRA\Desktop\eShopOnWeb-master>SonarScanner.MSBuild.exe begin /k:“dotn” /d:sonar.host.url=“http://localhost:9000” /d:sonar.login=“20743dad5dec5ef1733f8aee70e6ad4b6bce277c”
SonarScanner for MSBuild 4.3.1
Using the .NET Framework version of the Scanner for MSBuild
Default properties file was found at C:\sonar-scanner-msbuild-4.3.1.1372-net46\SonarQube.Analysis.xml
Loading analysis properties from C:\sonar-scanner-msbuild-4.3.1.1372-net46\SonarQube.Analysis.xml
Pre-processing started.
Preparing working directories…
20:36:46.383 Updating build integration targets…
20:36:46.43 Fetching analysis configuration settings…
20:36:48.039 Provisioning analyzer assemblies for cs…
20:36:48.039 Installing required Roslyn analyzers…
20:36:48.227 Pre-processing succeeded.

C:\Users\RUDRA\Desktop\eShopOnWeb-master>MsBuild.exe /t:Rebuild
Microsoft ® Build Engine version 14.0.23107.0
Copyright © Microsoft Corporation. All rights reserved.

Building the projects in this solution one at a time. To enable parallel build, please add the “/m” switch.
Build started 21-09-2018 20:36:54.
Project “C:\Users\RUDRA\Desktop\eShopOnWeb-master\eShopOnWeb.sln” on node 1 (Rebuild target(s)).
ValidateSolutionConfiguration:
Building solution configuration “Debug|Any CPU”.
Project “C:\Users\RUDRA\Desktop\eShopOnWeb-master\eShopOnWeb.sln” (1) is building “C:\Users\RUDRA\Desktop\eShopOnWeb-ma
ster\src\Infrastructure\Infrastructure.csproj.metaproj” (2) on node 1 (Rebuild target(s)).
C:\Users\RUDRA\Desktop\eShopOnWeb-master\src\Infrastructure\Infrastructure.csproj.metaproj : warning MSB4078: The proje
ct file “src\Infrastructure\Infrastructure.csproj” is not supported by MSBuild and cannot be built.
Done Building Project “C:\Users\RUDRA\Desktop\eShopOnWeb-master\src\Infrastructure\Infrastructure.csproj.metaproj” (Reb
uild target(s)).

Project “C:\Users\RUDRA\Desktop\eShopOnWeb-master\eShopOnWeb.sln” (1) is building “C:\Users\RUDRA\Desktop\eShopOnWeb-ma
ster\src\Web\Web.csproj.metaproj” (3) on node 1 (Rebuild target(s)).
C:\Users\RUDRA\Desktop\eShopOnWeb-master\src\Web\Web.csproj.metaproj : warning MSB4078: The project file “src\Web\Web.c
sproj” is not supported by MSBuild and cannot be built.
Done Building Project “C:\Users\RUDRA\Desktop\eShopOnWeb-master\src\Web\Web.csproj.metaproj” (Rebuild target(s)).

Project “C:\Users\RUDRA\Desktop\eShopOnWeb-master\eShopOnWeb.sln” (1) is building “C:\Users\RUDRA\Desktop\eShopOnWeb-ma
ster\src\ApplicationCore\ApplicationCore.csproj.metaproj” (4) on node 1 (Rebuild target(s)).
C:\Users\RUDRA\Desktop\eShopOnWeb-master\src\ApplicationCore\ApplicationCore.csproj.metaproj : warning MSB4078: The pro
ject file “src\ApplicationCore\ApplicationCore.csproj” is not supported by MSBuild and cannot be built.
Done Building Project “C:\Users\RUDRA\Desktop\eShopOnWeb-master\src\ApplicationCore\ApplicationCore.csproj.metaproj” (R
ebuild target(s)).

Project “C:\Users\RUDRA\Desktop\eShopOnWeb-master\eShopOnWeb.sln” (1) is building “C:\Users\RUDRA\Desktop\eShopOnWeb-ma
ster\tests\UnitTests\UnitTests.csproj.metaproj” (5) on node 1 (Rebuild target(s)).
C:\Users\RUDRA\Desktop\eShopOnWeb-master\tests\UnitTests\UnitTests.csproj.metaproj : warning MSB4078: The project file
“tests\UnitTests\UnitTests.csproj” is not supported by MSBuild and cannot be built.
Done Building Project “C:\Users\RUDRA\Desktop\eShopOnWeb-master\tests\UnitTests\UnitTests.csproj.metaproj” (Rebuild tar
get(s)).

Project “C:\Users\RUDRA\Desktop\eShopOnWeb-master\eShopOnWeb.sln” (1) is building “C:\Users\RUDRA\Desktop\eShopOnWeb-ma
ster\tests\IntegrationTests\IntegrationTests.csproj.metaproj” (6) on node 1 (Rebuild target(s)).
C:\Users\RUDRA\Desktop\eShopOnWeb-master\tests\IntegrationTests\IntegrationTests.csproj.metaproj : warning MSB4078: The
project file “tests\IntegrationTests\IntegrationTests.csproj” is not supported by MSBuild and cannot be built.
Done Building Project "C:\Users\RUDRA\Desktop\eShopOnWeb-master\tests\IntegrationTests\IntegrationTests.csproj.metaproj
" (Rebuild target(s)).

Project “C:\Users\RUDRA\Desktop\eShopOnWeb-master\eShopOnWeb.sln” (1) is building “C:\Users\RUDRA\Desktop\eShopOnWeb-ma
ster\tests\FunctionalTests\FunctionalTests.csproj.metaproj” (7) on node 1 (Rebuild target(s)).
C:\Users\RUDRA\Desktop\eShopOnWeb-master\tests\FunctionalTests\FunctionalTests.csproj.metaproj : warning MSB4078: The p
roject file “tests\FunctionalTests\FunctionalTests.csproj” is not supported by MSBuild and cannot be built.
Done Building Project “C:\Users\RUDRA\Desktop\eShopOnWeb-master\tests\FunctionalTests\FunctionalTests.csproj.metaproj”
(Rebuild target(s)).

Project “C:\Users\RUDRA\Desktop\eShopOnWeb-master\eShopOnWeb.sln” (1) is building “C:\Users\RUDRA\Desktop\eShopOnWeb-ma
ster\src\WebRazorPages\WebRazorPages.csproj.metaproj” (8) on node 1 (Rebuild target(s)).
C:\Users\RUDRA\Desktop\eShopOnWeb-master\src\WebRazorPages\WebRazorPages.csproj.metaproj : warning MSB4078: The project
file “src\WebRazorPages\WebRazorPages.csproj” is not supported by MSBuild and cannot be built.
Done Building Project “C:\Users\RUDRA\Desktop\eShopOnWeb-master\src\WebRazorPages\WebRazorPages.csproj.metaproj” (Rebui
ld target(s)).

Done Building Project “C:\Users\RUDRA\Desktop\eShopOnWeb-master\eShopOnWeb.sln” (Rebuild target(s)).

Build succeeded.

“C:\Users\RUDRA\Desktop\eShopOnWeb-master\eShopOnWeb.sln” (Rebuild target) (1) ->
“C:\Users\RUDRA\Desktop\eShopOnWeb-master\src\Infrastructure\Infrastructure.csproj.metaproj” (Rebuild target) (2) ->
(Rebuild target) ->
C:\Users\RUDRA\Desktop\eShopOnWeb-master\src\Infrastructure\Infrastructure.csproj.metaproj : warning MSB4078: The pro
ject file “src\Infrastructure\Infrastructure.csproj” is not supported by MSBuild and cannot be built.

“C:\Users\RUDRA\Desktop\eShopOnWeb-master\eShopOnWeb.sln” (Rebuild target) (1) ->
“C:\Users\RUDRA\Desktop\eShopOnWeb-master\src\Web\Web.csproj.metaproj” (Rebuild target) (3) ->
C:\Users\RUDRA\Desktop\eShopOnWeb-master\src\Web\Web.csproj.metaproj : warning MSB4078: The project file “src\Web\Web
.csproj” is not supported by MSBuild and cannot be built.

“C:\Users\RUDRA\Desktop\eShopOnWeb-master\eShopOnWeb.sln” (Rebuild target) (1) ->
“C:\Users\RUDRA\Desktop\eShopOnWeb-master\src\ApplicationCore\ApplicationCore.csproj.metaproj” (Rebuild target) (4) ->
C:\Users\RUDRA\Desktop\eShopOnWeb-master\src\ApplicationCore\ApplicationCore.csproj.metaproj : warning MSB4078: The p
roject file “src\ApplicationCore\ApplicationCore.csproj” is not supported by MSBuild and cannot be built.

“C:\Users\RUDRA\Desktop\eShopOnWeb-master\eShopOnWeb.sln” (Rebuild target) (1) ->
“C:\Users\RUDRA\Desktop\eShopOnWeb-master\tests\UnitTests\UnitTests.csproj.metaproj” (Rebuild target) (5) ->
C:\Users\RUDRA\Desktop\eShopOnWeb-master\tests\UnitTests\UnitTests.csproj.metaproj : warning MSB4078: The project fil
e “tests\UnitTests\UnitTests.csproj” is not supported by MSBuild and cannot be built.

“C:\Users\RUDRA\Desktop\eShopOnWeb-master\eShopOnWeb.sln” (Rebuild target) (1) ->
“C:\Users\RUDRA\Desktop\eShopOnWeb-master\tests\IntegrationTests\IntegrationTests.csproj.metaproj” (Rebuild target) (6)
->
C:\Users\RUDRA\Desktop\eShopOnWeb-master\tests\IntegrationTests\IntegrationTests.csproj.metaproj : warning MSB4078: T
he project file “tests\IntegrationTests\IntegrationTests.csproj” is not supported by MSBuild and cannot be built.

“C:\Users\RUDRA\Desktop\eShopOnWeb-master\eShopOnWeb.sln” (Rebuild target) (1) ->
“C:\Users\RUDRA\Desktop\eShopOnWeb-master\tests\FunctionalTests\FunctionalTests.csproj.metaproj” (Rebuild target) (7) -

C:\Users\RUDRA\Desktop\eShopOnWeb-master\tests\FunctionalTests\FunctionalTests.csproj.metaproj : warning MSB4078: The
project file “tests\FunctionalTests\FunctionalTests.csproj” is not supported by MSBuild and cannot be built.

“C:\Users\RUDRA\Desktop\eShopOnWeb-master\eShopOnWeb.sln” (Rebuild target) (1) ->
“C:\Users\RUDRA\Desktop\eShopOnWeb-master\src\WebRazorPages\WebRazorPages.csproj.metaproj” (Rebuild target) (8) ->
C:\Users\RUDRA\Desktop\eShopOnWeb-master\src\WebRazorPages\WebRazorPages.csproj.metaproj : warning MSB4078: The proje
ct file “src\WebRazorPages\WebRazorPages.csproj” is not supported by MSBuild and cannot be built.

7 Warning(s)
0 Error(s)

Time Elapsed 00:00:00.21

C:\Users\RUDRA\Desktop\eShopOnWeb-master>SonarScanner.MSBuild.exe end /d:sonar.login=“20743dad5dec5ef1733f8aee70e6ad4b6bce277c”
SonarScanner for MSBuild 4.3.1
Using the .NET Framework version of the Scanner for MSBuild
Default properties file was found at C:\sonar-scanner-msbuild-4.3.1.1372-net46\SonarQube.Analysis.xml
Loading analysis properties from C:\sonar-scanner-msbuild-4.3.1.1372-net46\SonarQube.Analysis.xml
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.
    20:37:03.727 Creating a summary markdown file…
    20:37:03.727 Post-processing failed. Exit code: 1

C:\Users\RUDRA\Desktop\eShopOnWeb-master>


(Valeri Hristov) #2

Hi @suman_kar, it seems that your project cannot be built - there are multiple lines with this message in your logs C:\Users\RUDRA\Desktop\eShopOnWeb-master\src\Infrastructure\Infrastructure.csproj.metaproj : warning MSB4078: The proje ct file “src\Infrastructure\Infrastructure.csproj” is not supported by MSBuild and cannot be built.


(Sun) #3

Do you have any advices when the project is built well in Visual Studio, but not in MSBuild.exe or dotnet build?

In my case, i get messages like :

C:\Builds\1\MBS.Payments.Forms.Mvc\MBS Payment Forms MVC\Sources\MBS.Payments.Forms.Mvc\MBS.Forms.Payments.Web\MBS.Forms.Payments.Web.csproj (979): The imported project “C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications\Microsoft.WebApplication.targets” was not found.

Do you have any idea?


(Valeri Hristov) #4

Unfortunately I cannot say what could be the problem. If you already have a working CI build you could see how it is configured and try to replicate the commands locally. Or you could just start from there and execute the begin and end steps of Scanner for MSBuild before and after the compilation step in your build definition. How to do that depends on what build system you are using (TFS/VSTS, Jenkins, etc.). For example, we have extensions for:

If you don’t have CI, I am afraid that it would be difficult to provide help on that, as this is something specific to your needs and I am not in a position to recommend solutions.