Uploaded image for project: '[DEPRECATED] SonarVB'
  1. [DEPRECATED] SonarVB
  2. SONARVB-246

Build fails when analyzers report location containing " Error:"

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.0
    • Component/s: None
    • Labels:
      None

      Description

      In summary, it's a known Roslyn issue #5724 _VBC emitting extra console output on warning with " error:"
      _. If the line containing the error contains the string " Error:" then MSBuild will fail. So far it is has only been affected VB rules S103 and S2178.

      Workarounds:

      • disable the affected rules in SonarQube, or
      • reformat the code to not include the string "My Error:" e.g. by concatenating two string together "My " & "Error:"

      Further investigation
      This does not affect the C# analyzers, even though the VB and C# analyzers share common code.
      The underlying issue is in the Roslyn Vbc MSBuild task. This wraps the call to the vbc.exe compiler. The corresponding C# task is Csc which wraps the C# compiler csc.exe. The difference is that Vbc does extra processing of the text output returned by the compiler, writing additional output that MSBuild interprets as being errors.

      I investigated the Microsoft MSBuild targets and tasks and the _vbc.exe _compiler command line to see if there any options we can set to modify the behaviour, but unfortunately there are not.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                amaury.leve Amaury Levé
                Reporter:
                duncan.pocklington Duncan Pocklington
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: