This page is covering a special case where you have a Solution made of C++ and C#. In such context, to have an accurate analysis of the C# code, you need to use the SonarQube Scanner for MSBuild.
The source code stored in shared folders, not considered as "Project" by Visual Studio, won't be scanned.
Step 1: Install the SonarQube Scanner for MSBuild
Download and install the SonarQube Scanner for MSBuild
Step 2: Prepare your build environment
Analysis of C and C++ projects requires the SonarQube Build Wrapper. It gathers all the configuration required for correct analysis of C/C++ projects (defined macros, include directories, …) directly from your project's build process. The Build Wrapper does not impact your build; it merely eavesdrops on it.
You can download the Build Wrapper directly from your SonarQube Server, so that its version perfectly matches your version of the plugin:
- Build Wrapper for Windows can be downloaded from URL http://localhost:9000/static/cpp/build-wrapper-win-x86.zip
- Unzip the downloaded Build Wrapper
- Configure it in your PATH because it's just more convenient
Step 3: Build and analyze your project using the Build Wrapper
MSBuild projects are analyzed in three steps (see example below):
- Execute the SonarQube Scanner for MSBuild "begin" step
- Add execution of Build Wrapper to your normal MSBuild build command
- Execute the SonarQube Scanner for MSBuild "end" step to complete the analysis
More information on configuring Visual C++ analysis in VSTS or TFS is available here.