30 is not a valid line offset for pointer

Versions:

  1. SonarQube: 7.5 (build 20543)
  2. SonarC#: 7.10 (build 7896)
  3. Scanner for MSBuild: 4.10

Problem
I’m getting the following error

ERROR: Error during SonarScanner execution
java.lang.IllegalArgumentException: 43 is not a valid line offset for pointer. File <filename> has 42 character(s) at line 10

or

ERROR: Error during SonarScanner execution
java.lang.IllegalArgumentException: 30 is not a valid line offset for pointer. File <another file> has 29 character(s) at line 120

I checked them with Notepad with ‘Show all symbols’ enabled and they both have 43 and 30 characters at the problematic lines accordingly.
At first, I though it might have something to do with encoding - it was UTF-8 with BOM - but even after I changed it to UTF-8, the error is still here

Hi,

Your version is past EOL. You should upgrade to either the latest version or the current LTS at your earliest convenience. Your upgrade path is:

7.5 → 7.9.6 → 8.9.8 → 9.5 (last step optional)

You may find the Upgrade Guide and the LTS-to-LTS Upgrade Notes helpful. If you have questions about upgrading, feel free to open a new thread for that here.

If your error persists after upgrade, please come back to us.

 
Ann