CsWinRT icon indicating copy to clipboard operation
CsWinRT copied to clipboard

Cannot retrieve a helper type for generic public type ICollection

Open FrayxRulez opened this issue 1 year ago • 2 comments
trafficstars

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

FrayxRulez avatar Aug 26 '24 16:08 FrayxRulez

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();

manodasanW avatar Sep 06 '24 08:09 manodasanW

.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

FrayxRulez avatar Sep 06 '24 11:09 FrayxRulez