SonarScanner for MSBuild 4.3.1
I have a VisualStudio 2017 solution. It contains many projects, including Windows Presentation Foundation (WPF) projects. The solution successfully builds under normal circumstances using MSBuild.exe.
When I try and analyse the solution using SonarScanner for MSBuild, I am getting a C# compiler (csc.exe) crash during the analysis of one of the WPF projects. I have run MSBuild with verbosity set to ‘diagnostic’ and can identify that the failure is caused by a stack overflow. Here is a short excerpt from the output generated by MSBuild:
Process is terminated due to StackOverflowException. (TaskId:8218)
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Roslyn\Microsoft.CSharp.Core.targets(52,5): error MSB6006: “csc.exe” exited with code -1073741571. [C:\Development\Trunk\XXX\source\YYY\GUI\WPF\Resources\Resources.csproj]
Output Item(s): CscCommandLineArgs= (TaskId:8218)
Done executing task “Csc” – FAILED. (TaskId:8218)
Done building target “CoreCompile” in project “Resources.csproj” – FAILED.: (TargetId:4681)
Has this behaviour been encountered before?
Is there a solution or a work-around?
(Searching for solutions on Google etc is difficult. Any search including the words ‘stack overflow’ tends to direct me to unrelated items on a certain developer site )