dotnet / reactive

The Reactive Extensions for .NET
http://reactivex.io
MIT License
6.74k stars 751 forks source link

Remove dynamic load of QueryDebugger #1968

Closed idg10 closed 1 year ago

idg10 commented 1 year ago

(Just use new() instead.)

Resolves #1942

This dynamic load has been unnecessary since commit 40e8696 modified CurrentPlatformEnlightenmentProvider to look for QueryDebugger in the assembly named System.Reactive. Before that, it used to look for one called System.Reactive.Debugger, in which case a dynamic load would have made sense. But since for almost 6 years now, it has been passing "System.Reactive" as the assembly name, there is absolutely no reason for this to be a dynamic load. The code that performs this dynamic load is also in System.Reactive, so the dynamic load is completely pointless.

This only ever happened when the debugger was attached, but it has become problematic because assembly trimming doesn't like dynamic loads. If you set true, this dynamic loading code in CurrentPlatformEnlightenmentProvider causes a trim analysis warning (IL2057). The warning could safely be ignored, but it shouldn't happen in the first place. This change should stop that warning from emerging.