CsWinRT
CsWinRT copied to clipboard
Cannot retrieve a helper type for generic public type ICollection
Describe the bug
The exception is thrown after calling FirstOrDefault on the value returned by VisualTreeHelper.FindElementsInHostCoordinates.
To Reproduce
var elements = VisualTreeHelper.FindElementsInHostCoordinates(...);
var first = elements.FirstOrDefault();
Version Info 2.1.1
I tried to repro this with the below, but didn't observe any exception. If you can provide a more complete repro that is still just the above, it would be helpful. I assume you are using CsWinRT 2.1.1, have WindowsSdkPackageVersion set to either the .38 version or the .41 version, and are on WinAppSDK 1.6.
var elements = VisualTreeHelper.FindElementsInHostCoordinates(new Rect(0,0,this.AppWindow.Size.Width, this.AppWindow.Size.Height), myButton);
var first = elements.FirstOrDefault();
.42 and WinAppSDK 1.6 preview2.
Any additional info I could provide? I reproduced this in a quite big solution and I didn't try to have a minimal repro