C# service incorrectly analyzed as Windows Form App

I ran SonarQube against the C# source for a Windows Service I am developing and it is reporting a bug stating that the attribute STAThread should be applied to the entry point. This seems to be because it thinks I am writing a WinForms app, not a service. Is there any way to override this?

Hi @Tunnicliffen , welcome to this forum! Could you please provide more details on what your application is doing?

I imagine you refer to RSPEC-4210, which has this implementation. We’re looking if your app is referencing a System.Windows.Forms assembly.

I’m afraid you cannot override this functionality, but you can mark the issue in SonarQube/SonarCloud as “False positive”.

Would you have a suggestion on how to improve the rule?