I too am having the same problem and this helped me:
https://codyanhorn.tech/blog/excluding-your-net-test-project-from-code-coverage https://learn.microsoft.com/en-us/visualstudio/test/customizing-code-coverage-analysis?view=vs-2022