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
Related
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
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
I have a .vbproj which is a VB.NET web application project. I can build the solution that contains this project and then right click on the project and publish locally. No issues from with VS 2013 professional update 3.
I am trying to build this solution and then publish the project outside of VS using the msbuild plugin from within Jenkins CI.
The project does not get published as it says it is skipping unpublishable project.
The command and it output is as follows:
Executing the command
cmd.exe /C C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
/t:Publish /p:VisualStudioVersion=12.0 /p:OutDir=C:/temp/eric
StarWebPortal/StarWebPortal/StarWebPortal.vbproj && exit
%%ERRORLEVEL%% from C:\Tools\Jenkins\jobs\STAR-dev_POC\workspace
[workspace] $ cmd.exe /C
C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe /t:Publish
/p:VisualStudioVersion=12.0 /p:OutDir=C:/temp/eric
StarWebPortal/StarWebPortal/StarWebPortal.vbproj && exit
%%ERRORLEVEL%% Microsoft (R) Build Engine version 4.0.30319.18408
[Microsoft .NET Framework, version 4.0.30319.18444] Copyright (C)
Microsoft Corporation. All rights reserved.
Build started 8/22/2014 11:46:51 AM. The target "MvcBuildViews" listed
in a BeforeTargets attribute at "C:\Program Files
(x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.targets
(840,131)" does not exist in the project, and will be ignored. Project
"C:\Tools\Jenkins\jobs\STAR-dev_POC\workspace\StarWebPortal\StarWebPortal\StarWebPortal.vbproj"
on node 1 (Publish target(s)).
_DeploymentUnpublishable: Skipping unpublishable project. Done Building Project
"C:\Tools\Jenkins\jobs\STAR-dev_POC\workspace\StarWebPortal\StarWebPortal\StarWebPortal.vbproj"
(Publish target(s)).
Any idea why it works from within VS and not from the msbuild command line?
You have to configure Jenkins to pass two additional arguments to MsBuild.exe which are /p:DeployOnBuild=true and /p:PublishProfile=your_publish_profile.pubxml.
The command should be like msbuild your_vb_project.vbproj /p:DeployOnBuild=true /p:PublishProfile=publish_profile.pubxml You don't need to specified path to publish_profile.pubxml as long as it's under the same directory with your vbproj.
As of Visual Studio 2013, MSBuild is now a separate component from the .NET Framework and is included in the install with VS. It is also available as a separate download for build servers. It looks like you are using the "old" v4.0 MSBuild path. You need to use the new MSBuild path which is something like C:\Program Files(x86)\MSBuild\12.0\bin. You need to configure the Jenkins MSBuild plugin to use this path.
I am trying to setup TeamCity 7.0 for a smart device application. My visual studio solution contains two projects:
SmartRead -> The mobile application
SmartReadInstaller -> A Smart Device CAB Project for creating CAB file
My TeamCity configuration seems to build the SmartRead application successfully and create the necessary artifacts. But, it seems MSBuild is not able to handle the SmartReadInstaller project. The TeamCity build logs says:
vddproj is not supported by MSBuild and cannot be built.
Here is the complete build log for reference:
[11:46:10]Checking for changes
[11:46:10]Publishing internal artifacts
[11:46:10]Clearing temporary directory: C:\TeamCity\buildAgent\temp\buildTmp
[11:46:10]Clean build enabled: removing old files from C:\TeamCity\buildAgent\work\e252314f72f0d569
[11:46:10]Checkout directory: C:\TeamCity\buildAgent\work\e252314f72f0d569
[11:46:10]Updating sources: server side checkout
[11:46:11]Starting: C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.MsBuildBootstrap.exe /workdir:C:\TeamCity\buildAgent\work\e252314f72f0d569 /msbuildPath:C:\Windows\Microsoft.NET\Framework\v3.5\MSBuild.exe
[11:46:11]in directory: C:\TeamCity\buildAgent\work\e252314f72f0d569
[11:46:13]SmartRead.sln.teamcity: Build target: TeamCity_Generated_Build (3s)
[11:46:13][SmartRead.sln.teamcity] TeamCity_Generated_Build (3s)
[11:46:13][TeamCity_Generated_Build] MSBuild (3s)
[11:46:13][MSBuild] SmartRead.sln: Build target: Rebuild (2s)
[11:46:13][SmartRead.sln] ValidateSolutionConfiguration
[11:46:13][ValidateSolutionConfiguration] Building solution configuration "Release|Any CPU".
[11:46:13]SmartRead\SmartRead.csproj: Build target: Rebuild (2s)
[11:46:13][SmartRead.sln] Rebuild (2s)
[11:46:16][Rebuild] CallTarget
[11:46:16][CallTarget] SmartReadInstaller:Rebuild
[11:46:16][SmartReadInstaller:Rebuild] Warning
[11:46:16][Warning] C:\TeamCity\buildAgent\work\e252314f72f0d569\SmartRead.sln warning MSB4078: The project file "SmartReadInstaller\SmartReadInstaller.vddproj" is not supported by MSBuild and cannot be built.
[11:46:16]Process exited with code 0
[11:46:16]Publishing internal artifacts
[11:46:16][Publishing internal artifacts] Sending build.finish.properties.gz file
[11:46:16]Publishing artifacts
[11:46:16]Build finished
Please note that I am using Visual Studio (sln) runner for building my application. How do I fix this? How do I build the CAB files for my project?
MSBuild does not support VS deployment projects. You may want to consider moving your installers to WiX as from the next version of Visual Studio deployment projects will become obsolete.
For the current projects build using Devenv.
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?