We have a C# application where we have the Program.cs file with the main method as an entry point. Why is SonarAnalyzer flagging this file and recommends adding a protected constructor or add the static keyword to the program class since this is not a utility class?
Hi @NetHealth
The idea is that your Program
class is not intended to be instantiated by other classes. To make this clear, you should make your Program
class static
or you should add a private/protected constructor. It’s just a way of making things clear using the language itself rather than adding comments.