To exclude my code from code coverage in a .net core webapi project, I apply the [System.Diagnostics.Analysis.ExcludeFromCodeCoverage]
attribute to the unwanted classes.
Now I would like to exclude Program.cs from my code coverage. However, in .net 6 I don't know how to apply an attribute to this file because it does not have a class declaration. Can anyone guide me on how I can apply an attribute to this file?