4.9.1. C# Build Executor Configuration

On Windows: For most accurate results, specify the shell that is used to build the project, e.g. Visual Studio Developer Prompt or PowerShell. This ensures that the same assemblies (DLLs) are loaded that are also used by Visual Studio. Sonargraph tries to locate the latest Visual Studio Developer Prompt at startup. If that is not the correct one to be used, the following MSDN page provides additional information: https://msdn.microsoft.com/en-us/library/ms229859%28v=vs.110%29.aspx You can right-click on the identified application and open the "save location" where you find the corresponding shortcut file. Right-click again on that file to open the properties and select the "Properties" tab. The executable can be found in the "Target" text field.

Visual Studio project files (.csproj) for C# projects are processed to examine inter-project dependencies, references to external assemblies, relevant source files and pre-processor options to be used. If Sonargraph is executed on Windows operating system, the latest C# installation is determined and MSBuild.exe is located. If this automatically determined executable is not correct, click on "Detect MsBuild.exe Candidates" to search for further possible executables. On other operating systems the built-in parser is used per default. If you have xbuild installed (the MSBuild implementation of the Mono platform), define the path to its executable here.


The built-in parser is sufficient for simple Visual Studio project files. But if advanced features are used, e.g. variables like $(VSInstallDir), user profiles or conditional constructs, you need to use MSBuild or xbuild.


A minimum "ToolsVersion" of 4.0 is required. This is fulfilled for Visual Studio 2010 and newer.

C# Build Executor
Figure 4.7. C# Build Executor