The Sonar Scanner for MSBuild is using the current working directory as the project root directory under which all sources have to be located, but this is a real problem for multiple repositories in the Azure DevOps Server extension, especially for shared repositories, a feature that should soon be implemented into the Microsoft build agents. This would then mean repositories can lie anywhere inside the working directory of the agent, so also outside the pipeline directory under which the sources are currently always located (currently it should always be somewhere below “_work\1\s” but in the future a repository could be located at “_work\ShareRepos\MyRepo”). The SonarQube extension for Azure DevOps Server is currently using the default working directory of the build agent as its own working directory, this works in most cases as long as the sources are located in the default working directory, but we would need this to be adaptable to any other directory to support multiple shared repositories in the future.
Currently the only way to analyse files in multiple shared repositories is to use the standalone scanner and set the sonar.projectBaseDir variable, which is not supported by Sonar Scanner for MSBuild because it uses the working directory. So we would really need this feature to be able to use Sonar Scanner for MSBuild.
I assume it shouldn’t be too hard to do this since its really just about making the working directory of the Sonar Scanner for MSBuild adaptable in the Azure DevOps Server extension.