I am using dot net 4.6.1 and dnx Rc1 Update 1 so i have project extension as webapplication1.xproj.
When I am trying to execute sonar runner, I am getting this project as Skipped one. At end step, getting this information:
MSBuild SonarQube Runner Bootstrapper 1.0.2.0
Default properties file was found at C:\adid\MSBuild.SonarQube.Runner- 1.0.2\Sona
rQube.Analysis.xml
Loading analysis properties from C:\adid\MSBuild.SonarQube.Runner- 1.0.2\SonarQub
e.Analysis.xml
Post-processing started.
MSBuild SonarQube Runner Post-processor 1.0.2.0
No analysable projects were found. SonarQube analysis will not be performed. Check the build summary report for details.
Generation of the sonar-properties file failed. Unable to complete Sonar Qube analysis.
20:35:04.487 Creating a summary markdown file...
Post-processing failed. Exit code: 1
Details of the build logs given below:
This type of projects are not yet supported by the SonarQube Scanner for MSBuild, but there is a ticket to add its support: https://jira.sonarsource.com/browse/SONARMSBRU-167
Related
i have been read xUnit getting test results in vsts
after build , it's run my test , and show all testcase pass.
but the task is failed, i can't find any reason from the log.
vstest.console.exe
"D:\a\1\s\Services\AuthManagement\XXXX.Management.Api.Test\bin\Release\netcoreapp2.1\XXXX.Management.Api.Test.dll"
"D:\a\1\s\Services\AuthManagement\XXXX.Management.Api.Test\obj\Release\netcoreapp2.1\XXXX.Management.Api.Test.dll"
/EnableCodeCoverage
/logger:"trx"
/TestAdapterPath:"D:\a\1\s"
/InIsolation
i run this command in my local nb, there's no any error.
in vsts there's had the error message
System.IO.FileNotFoundException: Unable to find tests for D:\a\1\s\Services\AuthManagement\XXXX.Management.Api.Test\obj\Release\netcoreapp2.1\XXXX.Management.Api.Test.dll. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk" and framework version settings are appropriate. Rerun with /diag option to diagnose further.
the XXXX.Management.Api.Test Project , already install Microsoft.NET.Test.Sdk nuget package
Based on the error message, it looks up the files in obj/release folder, which should be exclude, so you can add !**\obj\** to exclude the files in obj folder. For example;
**\*xUnitTest*.dll
!**\obj\**
I installed like these...
sonarqube-6.2 | sonar-scanner-2.8 | sonar-scanner-msbuild-2.2.0.24 | msbuild 14
And I made windows batch file to build and scan(sonar). but some projects are ok. but some projects are failed.
batch file is...
MSBuild.SonarQube.Runner.exe begin /k:%PROJECT_KEY% /n:%PROJECT_NAME% /v:%BUILD_VERSION% /d:sonar.verbose=true
MSBuild.exe "projects" /t:build /v:m
MSBuild.SonarQube.Runner.exe end
error message is...
SonarQube Scanner for MSBuild 2.2
Default properties file was found at C:\SONARQUBE\sonar-scanner-msbuild-2.2.0.24\SonarQube.Analysis.xml
Loading analysis properties from C:\SONARQUBE\sonar-scanner-msbuild-2.2.0.24\SonarQube.Analysis.xml
Post-processing started.
SonarQube Scanner for MSBuild 2.2
18:50:20.591 Loading the SonarQube analysis config from C:\jenkins_slave_buildpc\workspace\amis3_client_sonar.sonarqube\conf\SonarQubeAnalysisConfig.xml
18:50:20.592 Not running under TeamBuild
18:50:20.593 Analysis base directory: C:\jenkins_slave_buildpc\workspace\amis3_client_sonar.sonarqube
Build directory:
Bin directory: C:\jenkins_slave_buildpc\workspace\amis3_client_sonar.sonarqube\bin
Config directory: C:\jenkins_slave_buildpc\workspace\amis3_client_sonar.sonarqube\conf
Output directory: C:\jenkins_slave_buildpc\workspace\amis3_client_sonar.sonarqube\out
Config file: C:\jenkins_slave_buildpc\workspace\amis3_client_sonar.sonarqube\conf\SonarQubeAnalysisConfig.xml
Generating SonarQube project properties file to C:\jenkins_slave_buildpc\workspace\amis3_client_sonar.sonarqube\out\sonar-project.properties
The SonarQube MSBuild integration failed: SonarQube was unable to collect the required information about your projects.
Possible causes:
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 12.0 upwards are supported
The begin, build or end steps have not all been launched from the same folder
Writing processing summary to C:\jenkins_slave_buildpc\workspace\amis3_client_sonar.sonarqube\out\ProjectInfo.log
Generation of the sonar-properties file failed. Unable to complete SonarQube analysis.
18:50:20.615 Creating a summary markdown file...
18:50:20.617 Post-processing failed. Exit code: 1
I executed same batch file for sonar. but some project is ok. and some project is failed..
What makes this error message?
I got the similar error when trying to run MSBuild.SonarQube.Runner end command in teamcity.
Begin step and MSBuild step to build project was working fine.
When I given full path for runner and MSbuild in teamcity. It worked for me.
C:\SonarQube\sonar-scanner-msbuild-3.0.2.656\MSBuild.Sonarqube.runner.exe
begin /k:"Sonar key here" /n:"Sonar project here" /v:%build.number%
/d:sonar.log.level=DEBUG
"C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" [path for .sln file
here] /t:Rebuild
/p:VisualStudioversion=14.0;Configuration=Release;Platform="Any CPU"
C:\SonarQube\sonar-scanner-msbuild-3.0.2.656\MSBuild.Sonarqube.runner end
Another thing worth checking--especially if you're trying to run SonarQube from a build server--is whether it is operating in the local system profile. From the logs, you may see something like:
Installed SonarQube.Integration.ImportBefore.targets to C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft\MSBuild\15.0\Microsoft.Common.targets\ImportBefore
I found that this path did not exist, even though SonarQube's scanner happily claimed to have installed its targets there. My solution was to create a build agent account for executing the build tasks. This will cause SonarQube to install its targets to the user profile MSBuild folder. For example:
C:\Users\buildagent\AppData\Local\Microsoft\MSBuild\15.0\Microsoft.Common.targets\ImportBefore
Does SonarQube support .NET Compact Framework 3.5 as well as the full framework versions?
Initially, the project would not build as the tools version wasn't specified. Once the tools versions was specified, the project was successfully built using msbuild v14. However, the SonarQube MS integration failed as SonarQube was unable to collect the required information about my project.
My build environment is set up with SonarQube v5.6.1, MSBuildTools v2015, SonarQube Scanner for MSBuild v2.1, and SonarQube C# Plugin v5.3.2.
I created the following batch script to run an analysis of a project so the begin, build, and end steps are launched from the same folder:
MSBuild.SonarQube.Runner.exe begin /k:"myproject-6.0.8" /n:"myproject-6.0.8" /v:"6.0.8" /d:sonar.verbose=true
"C:\Program Files (x86)\MSBuild\14.0\Bin\msbuild.exe" /tv:3.5 /t:Rebuild "/p:Configuration=Debug,Platform=Any CPU" /verbosity:detailed "myproject.sln"
MSBuild.SonarQube.Runner.exe end
From the outputlog:
C:\Users\jgaoiran\Documents\Visual Studio 2008\Projects\myproject-6.0.8>MSBuild.SonarQube.Runner.exe end
SonarQube Scanner for MSBuild 2.1
Default properties file was found at C:\myJunk\bin\sonarqube\MSBuild.SonarQube.Runner-2.1\SonarQube.Analysis.xml
Loading analysis properties from C:\myJunk\bin\sonarqube\MSBuild.SonarQube.Runner-2.1\SonarQube.Analysis.xml
Post-processing started.
SonarQube Scanner for MSBuild End Step 2.1
11:51:48.178 sonar.verbose=true was specified - setting the log verbosity to 'Debug'
11:51:48.178 Loading the SonarQube analysis config from C:\Users\jgaoiran\Documents\Visual Studio 2008\Projects\myproject-6.0.8\.sonarqube\conf\SonarQubeAnalysisConfig.xml
11:51:48.178 Not running under TeamBuild
11:51:48.178 Analysis base directory: C:\Users\jgaoiran\Documents\Visual Studio 2008\Projects\myproject-6.0.8\.sonarqube
Build directory:
Bin directory: C:\Users\jgaoiran\Documents\Visual Studio 2008\Projects\myproject-6.0.8\.sonarqube\bin
Config directory: C:\Users\jgaoiran\Documents\Visual Studio 2008\Projects\myproject-6.0.8\.sonarqube\conf
Output directory: C:\Users\jgaoiran\Documents\Visual Studio 2008\Projects\myproject-6.0.8\.sonarqube\out
Config file: C:\Users\jgaoiran\Documents\Visual Studio 2008\Projects\myproject-6.0.8\.sonarqube\out
Generating SonarQube project properties file to C:\Users\jgaoiran\Documents\Visual Studio 2008\Projects\myproject-6.0.8\.sonarqube\out\sonar-project.properties
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 12.0 upwards are supported
3. The begin, build or end steps have not all been launched from the same folder
Writing processing summary to C:\Users\jgaoiran\Documents\Visual Studio 2008\Projects\myproject-6.0.8\.sonarqube\out\ProjectInfo.log
Generation of the sonar-properties file failed. Unable to complete SonarQube analysis.
11:51:48.194 Creating a summary markdown file...
Post-processing failed. Exit code: 1
I am using SonarQube 5.2 for calculating the metrics.
Everything works fine, when I run it using "Developer Command Prompt for VS2013".
But when I run the same commands using normal command prompt "cmd.exe" with or without administrator rights, I am getting the following error
C:\Windows\system32>"C:\sonarqube-5.2\bin\MSBuild.SonarQube.Runner.exe" end
SonarQube Scanner for MSBuild 1.1
Default properties file was found at C:\sonarqube-5.2\bin\SonarQube.Analysis.xml
Loading analysis properties from C:\sonarqube-5.2\bin\SonarQube.Analysis.xml
Post-processing started.
MSBuild SonarQube Runner Post-processor 1.0.2.0
11:39:29.774 sonar.verbose=true was specified - setting the log verbosity to 'Debug'
11:39:29.774 Loading the SonarQube analysis config from C:\Windows\system32\.sonarqube\conf\SonarQubeAnalysisConfig.xml
11:39:29.774 Not running under TeamBuild
11:39:29.774 Analysis base directory: C:\Windows\system32\.sonarqube
Build directory:
Bin directory: C:\Windows\system32\.sonarqube\bin
Config directory: C:\Windows\system32\.sonarqube\conf
Output directory: C:\Windows\system32\.sonarqube\out
Config file: C:\Windows\system32\.sonarqube\out
Generating SonarQube project properties file to C:\Windows\system32\.sonarqube\out\sonar-project.properties
No ProjectInfo.xml files were found. Possible causes: you specified an invalid build configuration or the custom MSBuild analysis targets were not imported.
Writing processing summary to C:\Windows\system32\.sonarqube\out\ProjectInfo.log
Generation of the sonar-properties file failed. Unable to complete SonarQube analysis.
11:39:29.79 Creating a summary markdown file...
Post-processing failed. Exit code: 1
Please let me know what could be isssue and how to resolve it.
The following steps are followed by me,
Executed all the commands from one location example - "D:\Test"
Added the following in the PATH environment variable
a. path to MSBUILD's 12.0 folder
The commands executed for analysis of metrics,
a. MSBuild.SonarQube.Runner.exe begin
b. MSBuild abc.csproj /t:Clean;Rebuild /p:VisualStudioVersion=12.0...;
c. MSBuild.SonarQube.Runner.exe end
I got the solution.
I should use the full path to MSBuild instead of putting it in the PATH variable, which causes this issue for SonarQube Analysis.
-->
MSBuild.SonarQube.Runner.exe begin
"%programfiles(x86)%\msbuild\12.0\bin\MSBuild.exe" abc.csproj /t:Clean;Rebuild /p:VisualStudioVersion=12.0...;
MSBuild.SonarQube.Runner.exe end
<--
I think, any command that requires Developer Command Prompt, should also work in the normal command prompt, provided the path to MSBUILD should be in full.
Regards,
Guru
This worked well. :)
Use the below lines code one by one after each exection is completed:
SonarQube.Scanner.MSBuild.exe begin /k:"ProjectKeyName" /n:"ProjectName" /v:"1.0"
"C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" /t:Rebuild
SonarQube.Scanner.MSBuild.exe end
Note:
Please replace the ProjectKeyname and projectName with yours (As per sonar-project.properties file created under your Project Root Folder)
Version used:
sonarqube-5.6.6 (tested in sonarqube-6.4 as well),
sonar-scanner-msbuild-3.0.0.629
Ive got CC.Net and NAnt (and MSBuild) running on a new VM-based build server (Win7-64 Pro).
CC.Net can call MSBuild just fine - but I run into problems there when dealing with project-scope builds. The conditionals just dont have what I need. Not even close.
So I decide to deal with those conditions by calling MSBuild with NAnt, which fails every time. When I run the nant script from the command prompt, I get this:
[loadtasks] Failure scanning "C:\nant\bin\extensions\common\2.0\Collection
Gen.dll" for extensions. Could not load file or assembly 'Microsoft.VSDesigner,
Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of
its dependencies. The system cannot find the file specified.
Buildfile: file:///c:/c7/projects/dyndata/dyndata.build
Target framework: Microsoft .NET Framework 4.0
Target(s) specified: build
build:
[loadtasks] Scanning directory "c:\nantcontrib\bin\lib" for extension assemblies
.
[echo] Building DynData v7.0.7
BUILD FAILED
c:\c7\projects\dyndata\dyndata.build(24,12):
Failed to start MSBuild.
c:\c7\projects\dyndata\dyndata.build(24,12):
External Program Failed: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbui
ld.exe (return code was 1)
Total time: 0.4 seconds.
c:\c7\projects\dyndata\dyndata.build(24,12):
Failed to start MSBuild.
c:\c7\projects\dyndata\dyndata.build(24,12):
'C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe' failed to start.
The directory name is invalid
The Designer assembly is present on this machine, which has VS2010 Pro installed on it.
The build folder is correct.
The framework folder is correct.
Umpteen searches for nant/msbuild and this message have yielded nothing substantive.
These items have been tried and failed to change the results:
Nant msbuild task with .net 4.0 rc
.NET projects build automation with NAnt/MSBuild + SVN (tho I am using Vault)
I tried to build the nant code so I could debug the problem via VS2010's debugger but the source project is an unworkable mess and wont even begin to build.
Ideas are welcome:)
I think the first error about Microsoft.VSDesigner is just a warning - not a failure. On my developer box and build server I have VS2005 and VS2010 Pro installed and I do not have Microsoft.VSDesigner version 7 installed. I have version 8 and 9 installed but not 7.
It looks like the "build" target is running in nant and then then it fails. You are loading the tasks from nantcontrib then trying to start msbuild. How are you starting msbuild? Could you post the part of the nant file that starts it? What version of nant are you using? Does running nant with -v and -debug+ flags show anything helpful?