msbuild - Sonar and TFS 2013 : No ProjectInfo.xml files were found -
when run tfs 2013 sonar following error: no projectinfo.xml files found. check analysis targets referenced msbuild projects being built.
message: tf270015: 'sonarqube.msbuild.runner.exe' returned unexpected exit code. expected '0'; actual '1'.
i use :
- sonarqube-5.1.zip
- sonar-csharp-plugin-4.0.jar
- sonarqube.msbuild.runner-0.9.zip
- sonar-runner-dist-2.4.zip
i've followed instructions found in "sonarqube installation guide existing tfs environment.pdf".
any ?
thank you.
log :
sonarqube analysis summary analysis failed sonarqube project "wpfapplication2", version 1.0 product projects: 0, test projects: 0 invalid projects: 0, skipped projects: 0, excluded projects: 0 résumé debug | x86 0 erreur(s), 1 avertissement(s) $/essai2/wpfapplication2/wpfapplication2.sln - 0 erreur(s), 1 avertissement(s), afficher le fichier journal c:\builds\1\essai2\wpfapplication2\src\documents\visual studio 2013\projects\wpfapplication2\wpfapplication2.sln.metaproj : specified solution configuration "debug|x86" invalid. please specify valid solution configuration using configuration , platform properties (e.g. msbuild.exe solution.sln /p:configuration=debug /p:platform="any cpu") or leave properties blank use default solution configuration. $/essai2/wpfapplication2/wpfapplication2.sln compilé aucun résultat des tests aucun résultat de couverture du code autres erreurs et avertissements 2 erreur(s), 0 avertissement(s) 01:45:52: no projectinfo.xml files found. check analysis targets referenced msbuild projects being built. exception message: tf270015: 'sonarqube.msbuild.runner.exe' returned unexpected exit code. expected '0'; actual '1'. see build logs more details. (type unexpectedexitcodeexception) exception stack trace: @ system.activities.statements.throw.execute(codeactivitycontext context) @ system.activities.codeactivity.internalexecute(activityinstance instance, activityexecutor executor, bookmarkmanager bookmarkmanager) @ system.activities.runtime.activityexecutor.executeactivityworkitem.executebody(activityexecutor executor, bookmarkmanager bookmarkmanager, location resultlocation)
here diagnostic (i truncated source check out part) :
compile, test , publish00:00:46 run optional script before msbuild00:00:08 inputsenvironmentvariables: enabled: true arguments: /key:wpfapplication2 /name:wpfapplication2 /version:1.0 filepath: c:\sonarqube\bin\sonarqube.msbuild.runner.exe outputsresult: 0 c:\sonarqube\bin\sonarqube.msbuild.runner.exe /key:wpfapplication2 /name:wpfapplication2 /version:1.0 pre-processing (3 arguments passed) using environment variables determine download directory... using environment variable 'tf_build_builddirectory', value 'c:\builds\1\essai2\wpfapplication2' creating analysis bin directory: c:\builds\1\essai2\wpfapplication2\sqtemp\bin sonarqube server url: http://localhost:9000 downloading sonarqube.msbuild.runner.implementation.zip http://localhost:9000/static/csharp/sonarqube.msbuild.runner.implementation.zip c:\builds\1\essai2\wpfapplication2\sqtemp\bin\sonarqube.msbuild.runner.implementation.zip executing file c:\builds\1\essai2\wpfapplication2\sqtemp\bin\sonarqube.msbuild.preprocessor.exe args: "/key:wpfapplication2" "/name:wpfapplication2" "/version:1.0" working directory: c:\builds\1\essai2\wpfapplication2\sqtemp\bin timeout (ms):300000 process id: 4168 01:45:11: path sonar-runner.properties file not supplied on command line. attempting locate file... 01:45:11: located runner properties file: c:\sonar-runner-2.4\conf\sonar-runner.properties 01:45:11: legacy teambuild environment detected 01:45:11: creating config , output folders... 01:45:11: removing existing directory: c:\builds\1\essai2\wpfapplication2\sqtemp\conf 01:45:11: creating directory: c:\builds\1\essai2\wpfapplication2\sqtemp\conf 01:45:11: removing existing directory: c:\builds\1\essai2\wpfapplication2\sqtemp\out 01:45:11: creating directory: c:\builds\1\essai2\wpfapplication2\sqtemp\out generating fxcop ruleset... 01:45:14: saving config file c:\builds\1\essai2\wpfapplication2\sqtemp\conf\sonarqubeanalysisconfig.xml process returned exit code 0 run msbuild00:00:12 inputsprojectstobuild: string[] array msbuildmultiproc: true verbosity: normal toolplatform: auto targets: runcodeanalysis: asconfigured commandlinearguments: /p:skipinvalidconfigurations=true /p:configuration=debug /p:platform="any cpu" configurationstobuild: string[] array outputlocation: singlefolder enabled: true toolversion: cleanbuild: true outdir: restorenugetpackages: true c:\program files\microsoft team foundation server 12.0\tools\nuget.exe restore "c:\builds\1\essai2\wpfapplication2\src\documents\visual studio 2013\projects\wpfapplication2\wpfapplication2.sln" -noninteractive c:\program files (x86)\msbuild\12.0\bin\amd64\msbuild.exe /nologo /noconsolelogger "c:\builds\1\essai2\wpfapplication2\src\documents\visual studio 2013\projects\wpfapplication2\wpfapplication2.sln" /nr:false /fl /flp:"logfile=c:\builds\1\essai2\wpfapplication2\src\documents\visual studio 2013\projects\wpfapplication2\wpfapplication2.log;encoding=unicode;verbosity=normal" /p:skipinvalidconfigurations=true /p:configuration=debug /p:platform="any cpu" /m /p:outdir="c:\builds\1\essai2\wpfapplication2\bin\\" /p:configuration="debug" /p:platform="x86" /p:vcbuildoverride="c:\builds\1\essai2\wpfapplication2\src\documents\visual studio 2013\projects\wpfapplication2\wpfapplication2.sln.x86.debug.vsprops" /dl:workflowcentrallogger,"c:\program files\microsoft team foundation server 12.0\tools\microsoft.teamfoundation.build.server.logger.dll";"verbosity=normal;builduri=vstfs:///build/build/52;ignoreduplicateprojects=false;informationnodeid=12;targetsnotlogged=getnativemanifest,getcopytooutputdirectoryitems,gettargetpath;logprojectnodes=true;logwarnings=true;tfsurl=http://localhost:8080/tfs/defaultcollection;"*workflowforwardinglogger,"c:\program files\microsoft team foundation server 12.0\tools\microsoft.teamfoundation.build.server.logger.dll";"verbosity=normal;" /p:buildid="dbda6e4d-d5bc-4eed-8b3e-6cc79e3721cc,vstfs:///build/build/52" /p:buildlabel="wpfapplication2_20150615.3" /p:buildtimestamp="mon, 15 jun 2015 11:44:59 gmt" /p:buildsourceversion="lwpfapplication2_20150615.3@$/essai2" /p:builddefinition="wpfapplication2" run optional script after msbuild00:00:00 inputsenvironmentvariables: enabled: true arguments: filepath: outputsresult: 0 run optional script before test runner00:00:00 inputsenvironmentvariables: enabled: true arguments: filepath: outputsresult: 0 run vs test runner00:00:00 inputstestspecs: buildparameter[] array enabled: false configurationstotest: string[] array outdir: activity not run since enabled property set false. run optional script after test runner00:00:25 inputsenvironmentvariables: enabled: true arguments: filepath: c:\sonarqube\bin\sonarqube.msbuild.runner.exe outputsresult: 0 c:\sonarqube\bin\sonarqube.msbuild.runner.exe post-processing (no arguments passed) using environment variables determine download directory... using environment variable 'tf_build_builddirectory', value 'c:\builds\1\essai2\wpfapplication2' executing file c:\builds\1\essai2\wpfapplication2\sqtemp\bin\sonarqube.msbuild.postprocessor.exe args: working directory: c:\builds\1\essai2\wpfapplication2\sqtemp\bin timeout (ms):3600000 process id: 6548 01:45:28: legacy teambuild environment detected 01:45:28: loading sonarqube analysis config c:\builds\1\essai2\wpfapplication2\sqtemp\conf\sonarqubeanalysisconfig.xml 01:45:28: legacy teambuild environment detected 01:45:28: attempting locate codecoverage.exe tool... 01:45:28: code coverage command line tool: c:\program files (x86)\microsoft visual studio 12.0\team tools\dynamic code coverage tools\codecoverage.exe 01:45:28: fetching code coverage report information tfs... 01:45:28: connecting tfs... 01:45:29: fetching build information... 01:45:30: fetch code coverage report info... 01:45:52: operation timed out, elapsed time (ms): 20358 01:45:52: ...done. 01:45:52: no code coverage reports found current build. 01:45:52: generating sonarqube project properties file c:\builds\1\essai2\wpfapplication2\sqtemp\out\sonar-project.properties 01:45:52: no projectinfo.xml files found. check analysis targets referenced msbuild projects being built. 01:45:52: writing processing summary c:\builds\1\essai2\wpfapplication2\sqtemp\out\projectinfo.log 01:45:52: generation of sonar-properties file failed. unable complete sonarqube analysis. 01:45:52: updating teambuild summary... process returned exit code 1 exception message: tf270015: 'sonarqube.msbuild.runner.exe' returned unexpected exit code. expected '0'; actual '1'. see build logs more details. (type unexpectedexitcodeexception) exception stack trace: @ system.activities.statements.throw.execute(codeactivitycontext context) @ system.activities.codeactivity.internalexecute(activityinstance instance, activityexecutor executor, bookmarkmanager bookmarkmanager) @ system.activities.runtime.activityexecutor.executeactivityworkitem.executebody(activityexecutor executor, bookmarkmanager bookmarkmanager, location resultlocation) handle exception
troubleshooting issues msbuild.runner v0.9
the following information provided troubleshooting issues version 0.9 of msbuild.runner. behaviour may change in later versions.
most serious configuration issues result in warnings or errors appear on build summary page. in cases in there no errors or warnings reported, check tfs teambuild diagnostic output (click on "diagnostics" link @ top of build summary report in visual studio). both pre- , post-processor steps log quite lot of information diagnose issues.
1. check sonarqube analysis summary section appears in build summary report
the section should this:
sonarqube analysis summary analysis failed sonarqube project "simple console app", version 1.0 product projects: 4, test projects: 2 invalid projects: 0, skipped projects: 0, excluded projects: 0 if section not appear on build summary page there configuration issues build agent, build definition, or both. read steps below diagnose these further.
1.1 check number of projects reported in summary
if no projects found suggests integration targets not being imported , used during build.
if of projects marked invalid, building more 1 configuration e.g. [release or debug] | [x86 or x64]. should error saying no projectinfo.xml files found.
you can analyse 1 configuration @ time. if want analyze both release , debug builds, need create separate build definition each, using different sonarqube project ids.
the diagnostic log contain more infomation why project invalid, because project doesn't have guid, or guid not unique. normal reason non-unique guid building multiple configurations e.g. release , debug.
2. check pre-build step being executed
the diagnostic output should contain output similar following:
run optional script before msbuild
c:\sonarqube\bin\sonarqube.msbuild.runner.exe /key:myproject /name:"my project" /version:1.0
pre-processing (3 arguments passed)
if doesn't, check correctly calling sonarqube.msbuild.runner.exe in "pre-build script" step in build definition. easy mistake put script parameters in wrong box setting "post-build" properties instead (unhelpfully, post-build fields in ui appear before pre-build fields).
2. check post-build step being executed
the diagnostic output should contain output similar following:
run optional script after test runner
c:\sonarqube\bin\sonarqube.msbuild.runner.exe
post-processing (no arguments passed)
if doesn't, check correctly calling sonarqube.msbuild.runner.exe in "post-test script" step in build definition.
3. check rest of diagnostic log
if pre- , post- build steps being executed correctly, check rest of diagnostic output clues isn't working. pay particular attention messages pre- , post-processor directories , files writing to.
4. check files have been created on build agent
the analysis process creates temporary files under build directory under folder called sqtemp in v0.9. examining contents of folders can determine stage @ analysis failing.
the expected folders follows:
bin: folder contains analysis targets , binaries. created sonarqube.msbuild.runner.exe downloads files sonarqube server. if folder not exist or empty analysis failed @ stage , there should warnings or errors. check c# plugin v4 installed correctly on sonarqube server, , sonarqube has been restarted since plugin installed.
conf: folder created during pre-processing , contains settings downloaded sonarqube server. if there fxcop rules active in sonarqube folder should contain fxcop ruleset.
out: folder populated during msbuild phase. should contain 1 folder per project being built. contain generated sonar-project.properties file passed sonar-runner. if folder empty possible sonarqube.integration.targets not being imported correctly. error message "no projectinfo.xml files found" appear in case. projectinfo.xml files generated target "writesonarqubedata" in sonarqube.integration.targets, next thing check sonarqube.integration.targets being imported correctly , expected targets being executed.
5. checking sonarqube.integration.targets imported , called
firstly, double-check installation of sonarqube.integration.importbefore.targets file:
- check in correct folder version of msbuild using i.e. %programfiles(x86)%\msbuild\[12.0 or 14.0]\microsoft.common.targets\importbefore
- check typos in folder name "importbefore" (should singular, not plural) (thanks richard blackmarble tip).
if targets installed correctly need increase verbosity of msbuild logging diagnostic , build again can check detailed msbuild output. unfortunately, there doesn't seem simple way increase verbosity of msbuild logs when running under teambuild 2013. can produce additional log file more detail, need access build agent machine pick log file.
to create msbuild log more detailed info:
- select "queue new build" build menu in visual studio
- click on "parameters" tab.
- expand "2. build" section , "5. advanced" sections
- set "msbuild arguments" property following: /m:1 /fl2 /flp2:"verbosity=diagnostic" "/m:1" tells msbuild not build in parallel can make log easier read. other 2 parameters tell msbuild log file. see msbuild command line more info.
- click "queue" , wait build finish.
- find , open log on build agent. should called msbuild2.log , under source directory build definition.
if sonarqube.intergration.importbefore.targets being executed, there log entry saying "sonarqubeimportbeforeinfo" target executed. there should output message saying whether file "sonarqube.integration.targets" located or not.
the projectinfo.xml files written target "writesonarqubeprojectdata". log should show target has been executed, , "writeprojectinfofile" task has executed. if not, log should give idea of why targets skipped.
Comments
Post a Comment