Support trimming
Trimming is enabled by default in .net8, and .net7 introduced breaking change where dependencies are trimmed by default as well.
Tasks:
- Handle constructors that are used by reflection and removed by trimming
- Add smoke tests for trimmed mode for multiple target frameworks