-
Notifications
You must be signed in to change notification settings - Fork 708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ItemsView produces Failed to assign to property 'Microsoft.UI.Xaml.Controls.ItemsRepeater.ItemTransitionProvider'. exception #8810
Comments
@adamfierek can you share a small repro project ? |
Run into exactly same problem. (same Windows/SDK and VS versions) |
Yes, I can, but it's a bit difficult since it works on fresh solution and our current project is so big. I will try to provide repro. Meanwhile can you look at @RobertK66 project? It seems to be the same issue. |
Same problem here, seems to be caused when using/referencing: CommunityToolkit.WinUI.UI.Controls |
Yes, that's it. |
if I want to make it work AND keep my SettingsControls, I have to manually add the |
Calling out here that This seems like a NuGet or dll resolution issue or something when referencing an older WASDK built library against an app built with the latest (or newer) SDK? @bpulliam FYI. |
I would migrate to 8.0 but there is a lack of features currently used by me comparing to 7.x. |
Same here, using only DataGrid 7.x version, finished to use ItemsRepeater, basically the same thing. |
The 7.x and 8.x packages of the Toolkit are built completely differently. I don't even think the 7,x DataGrid referenced WinUI 2.x. The only common thread here is the Windows App SDK and the upgrade to 1.4? |
I think it can be closed since we know it's caused by 3rd party reference |
No, there is nothing specific in the third-party reference causing this. It's not a problem in the third-party library. The stack itself isn't contained within the third-party reference. The fact a version of the package from 2-years ago referencing the WindowsAppSDK v1.0 should mean it's not an issue within the packages themselves. Something with ItemsView or the platforms dependency resolution is broken here. Even if it is, there's literally nothing we could change without the platform team root-causing what's happening here and saying that all packages now need to do X instead with 1.4+. In either case, this is an issue that should remain open with the platform - there's something going on within the platform itself that is unknown when another NuGet dependency is being added (it could be beyond the scope of the just the Toolkit). It needs to be resolved and is something the platform team needs to investigate. There could be any number of other third-party libraries that are affected, there's no action for us to do right now in the Toolkit on here. Two different packages from us with completely different ways of being built and with completely different code highlight the problem within ItemsView, there's nothing we can even start or go on to know to change to resolve this issue in ItemsView. |
I think I found the cause of this issue. Steps to reproduce: make a Windows App SDK 1.4 Application using ItemsView Control You have 2 options to resolve this from here: I think the underlying problem is, that the first dll getting its resources loaded can decide which version of the ItemsRepeater gets used by all others !!??? (content also copied to : CommunityToolkit/Windows#234 ) |
unchanged/still an issue in Version 1.4.3 (1.4.231115000). repos with demo for crash upgraded: https://github.com/RobertK66/WinUi3 |
Thanks @kmahone for digging into this. Here is what happens: LibraryFoo uses ItemsRepeater. App loads xaml that includes ItemsRepeater. Xaml Parser looks up metadata for ItemsRepeater from App’s IXMP. The App does not include the definition of ItemsRepeater so it forwards it on to ‘OtherProviders’. OtherProviders references both LibraryFoo IXMP and XamlControlsMetadataProvider. It checks both. It happens to have them in alphabetical order, so it checks LibraryFoo first. Since LibraryFoo DOES know about ItemsRepeater it returns the IXMP for it. But this IXMP is for the 1.3 api surface, so it is missing stuff. When the xaml parser tries to set one of the newer apis, it fails since it does not have the metadata for that property. If you rename LibraryFoo to ZLibraryFoo it happens to change the sort order in OtherProviders and so the scenario works. |
We will need to fix this in the Xaml Compiler so that the generated IXMP works correctly in this scenario. It should ensure that the XamlControlsXamlMetaDataProvider is always first in the list of OtherProviders. Until this issue is fixed, here is one way to work around the issue. In your app's csproj file add this property to the first PropertyGroup:
This will cause the Xaml Compiler to not populate the OtherProviders list. You now need to populate it manually. In your App's constructor, call AddOtherProvider to add each of the IXamlMetadataProviders that were previously being generated. Since you can now control the order you can make sure that XamlControlsXamlMetaDataProvider comes first:
The downside to this is you need to manually add any new IXMP implementations that your app needs if you add a new dependency to your app. |
This issue also reproduces on WindowsAppSDK 1.5 (SelectorBar) with CommunityToolkit controls (etc. SettingsControls) 8.0.2. I changed to code to use manually add other provides for an temporary solution. |
Hello, I have the same issue and I don't understand anything as workaround that was written here. Could you please provide a way to not have this error for a dummy ? thanks |
I've created a temporary solution sample project for this issue: Issue8810TemporarySolution. Hope it will help. |
I merged a fix for this issue into internal builds. I expect the fix to ship in WinAppSDK 1.6. |
ok, this is in status 'closed' now since 3 weeks ago! I can not find any 1.6 release yet! And here there is no trace of any 1.6 - prerelease either.... I personally find this projects usage of github/github-issues really 'strange'. As a 'contributing consuming' developer I have no Idea at all what's going on and what to expect...... |
1.6-experimental1 has now been released, on June 4. |
…xaml#8810 not released yet. reintroduce SettingsPage
…we still need the CommunityToolkit rc version!!!!
Describe the bug
After try to display page with ItemsView, XamlParsingFailed is thrown:
Failed to assign to property 'Microsoft.UI.Xaml.Controls.ItemsRepeater.ItemTransitionProvider'.
Steps to reproduce the bug
Place ItemsView in xaml
Expected behavior
working control
Screenshots
No response
NuGet package version
Windows App SDK 1.4.0: 1.4.230822000
Packaging type
Unpackaged
Windows version
Windows 11 version 22H2 (22621, 2022 Update)
IDE
Visual Studio 2022
Additional context
No response
The text was updated successfully, but these errors were encountered: