This pull request addresses an issue where an exception is thrown when processing solution files (.sln) that contain #pragma directives.
[ERR] Target InitializeCoverageCollector has thrown an exception
System.IndexOutOfRangeException: Index was outside the bounds of the array.
Problem
When a .sln file contains #pragma directives, the existing GetGlobalSection method does not handle these lines properly, leading to an IndexOutOfRangeException. This is due to the assumption that all lines within a GlobalSection will conform to expected key-value pairs, which is not the case when #pragma lines are present.
The proposed change adds a filter to skip lines starting with # within the GlobalSection.
This pull request addresses an issue where an exception is thrown when processing solution files (.sln) that contain #pragma directives.
Problem When a .sln file contains #pragma directives, the existing GetGlobalSection method does not handle these lines properly, leading to an IndexOutOfRangeException. This is due to the assumption that all lines within a GlobalSection will conform to expected key-value pairs, which is not the case when #pragma lines are present.
The proposed change adds a filter to skip lines starting with # within the GlobalSection.
I confirm that the pull-request: