Template for a good bug report, formatted with Markdown:
versions used: VSTS SonarCloud Version 1.4.0 - SonarScanner for MSBuild 4.4.1
error observed:
CreateProjectSpecificDirs:
2018-10-12T18:53:18.3982024Z Creating directory "D:\a\1\.sonarqube\conf\0".
2018-10-12T18:53:20.4236768Z ##[error]D:\a\1\.sonarqube\bin\targets\SonarQube.Integration.targets(381,5): Error MSB4044: The "GetAnalyzerSettings" task was not given a value for the required parameter "Language".
2018-10-12T18:53:20.4251438Z D:\a\1\.sonarqube\bin\targets\SonarQube.Integration.targets(381,5): error MSB4044: The "GetAnalyzerSettings" task was not given a value for the required parameter "Language". [D:\a\1\s\AzureInfra\AzureInfra.deployproj]
2018-10-12T18:53:20.4618851Z Done Building Project "D:\a\1\s\AzureInfra\AzureInfra.deployproj" (default targets) -- FAILED.
VS 2017 solution with a Azure Resource Deployment project. Prepare analysis hasnât changed. Build starting failing since release 1.4 on October 12 using SonarScanner for MSBuild 4.4.1. When solution is compiled in CI pipeline, builds crash with the error above.
potential workaround: Tried adding sonar.exclusions=*.deployproj in extraProperties of inputs but exclusion is not applied, build still fails.
P.S.: use the #bug:fault sub-category if youâre hitting a specific crash/error , or the #bug:fp sub-category for rules-related behaviour
We are noticing the same issue.
See error message below.
f:\BuildSource\VSTS1\6.sonarqube\bin\targets\SonarQube.Integration.targets(381,5): Error MSB4044: The âGetAnalyzerSettingsâ task was not given a value for the required parameter âLanguageâ. Process âmsbuild.exeâ exited with code â1â. f:\BuildSource\VSTS1\6.sonarqube\bin\targets\SonarQube.Integration.targets(381,5): Error MSB4044: The âGetAnalyzerSettingsâ task was not given a value for the required parameter âLanguageâ. Process âmsbuild.exeâ exited with code â1â.
Is there any workaround? We started noticing this error message on 2018/10/12.
Same problem, first noticed on 12/10/2018.
Unfortunately @quintush work around is not viable, as that would mean editing 30+ dcproj files, pull requests, approvals, etc etc. to work around a problem that did not exist a week ago.
Is there a fix planned by Sonarcloud. Or will this remain as expected behaviour and require customers to make dev changes to resolve?
Is anyone aware of a workaround that can be done in the build definition, this would be fine as it means 1 change in a task group common to all project build.
{
"name": "extraProperties",
"type": "multiLine",
"label": "Additional Properties",
"defaultValue":
"# Additional properties that will be passed to the scanner, \n# Put one key=value per line, example:\n# sonar.exclusions=**/*.bin",
"required": false,
"properties": {
"resizable": "true",
"rows": "5"
},
Since we are using Azure devops and not annotating any SonarQube specific code in our .NET solution the provided workaround is not valid for us. What would also help is to specify a specific version of SonarQube to use instead of the latest 4.x version from wihin our build pipeline.
It broke our pipeline and our build agent, since it left the agent in an inconsistent state (all kind of SonarQube dllâs were not cleaned, resulting in even more errors).
To fix the agent, we had to move the âRun code analysisâ task before the build, so that it could fail gracefully and clean up all the SonarQube dependencies. Hopefully this helps anyone.
Hereâs a powershell script I wrote to automatically implement @quintushâs fix on all deployproj files in the Azure DevOps sources directory. I have it running towards the start of the build, before the SonarQube âprepare analysisâ step.
@all, the issue is being tracked by Scanner for MSBuild issue #589. Weâve released new versions of the scanner and the VSTS tasks to address the issue. Please let us know if you are still experiencing problems.
Please accept our apologies for the inconvenience.
Root cause: a property in one of our custom MSBuild tasks was marked as Required in version 4.4.1. The Scanner for MSBuild is embedded in the Azure DevOps SonarCloud and SonarQube extensions, which were re-released on Friday. The new versions of the extensions were minor updates, so they would have been automatically deployed by the build agents the next time a build using the task was executed.