We’re using SonarQube v9.9.2 (build 77730) being run from Azure pipeline task SonarQubeAnalyze@5.
For one of our repos we are getting the following error:
##[error]ERROR: Unable to parse file: file:///home/vsts/work/1/s/src/CompanyName.Frameworks.Testing.Architecture/TargetFramework/Dockerfile.cs. Parse error at position 1:0
I have attached the full log which contains the very simple 11 lines of code that makes up Dockerfile.cs
, a very simple record containing just four properties and nothing else.
Looking at the log, the lines just before the error states:
2024-04-08T14:11:35.6787131Z INFO: Sensor IaC Docker Sensor [iac]
2024-04-08T14:11:35.6900845Z INFO: 1 source file to be analyzed
There is nothing wrong with the C# file and its language version is supported by this version of SonarQube. Is it possible that SonarQube is treating this file like a Dockerfile rather than a C# file purely because of its name? Although a Docker file would typically not have a .cs
file extension.
If not, what else could be the problem with this file?
Thanks!