SonarScanner MSBuild cannot follow junction paths properly

Versions Used

  • SonarQube: 7.3
  • SonarScanner.MSBuild: 4.3.1.1372

Setup

Windows machine with two drives - C: and E:

C:\deploy\work is where code is checked out to and the builds done via CI tools.

C:\deploy is a junction to E:\deploy.

All of our CI builds are run using C:\deploy\work as their base checkout directory.

Error observed

When running the scanner with the end parameter, it cannot follow any of the junction links to output or report files. eg. code coverage file is at c:\deploy\work\Coverage\Coverage.xml but for some reason the scanner is looking at the E:\ instead. Protobuf files are also showing this issue where they aren’t where the scanner expects them to be.

Workaround

Changed all paths to use the absolute path. However this causes more CI issues so this is not a long term solution.