Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] xamarin forms 4.8 Uwp shell excepion on navigation ArgumentException: An item with the same key has already been added. Key: background #11768

Closed
filipoff2 opened this issue Aug 12, 2020 · 6 comments
Labels
a/style s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. s/needs-repro ❔ This reported issue doesn't include a sample project reproducing the issue. Please provide one. s/unverified New report that has yet to be verified t/bug 🐛

Comments

@filipoff2
Copy link

After update to "Xamarin.Forms" Version="4.8.0.1269"

Getting other exception on
ArgumentException: An item with the same key has already been added. Key: background

line 71:
rootFrame.Navigate(typeof(MainPage), e.Arguments);
In
https://github.com/filipoff2/MagicGradients/blob/issues/Add-UWP-Playground-Project-45/Playground/Playground.UWP/App.xaml.cs

Result:
On 4.8 App is crashing on start
On 4.5 navigation was not done.

@filipoff2 filipoff2 added s/unverified New report that has yet to be verified t/bug 🐛 labels Aug 12, 2020
@filipoff2
Copy link
Author

#8498 (comment)

@PureWeen
Copy link
Contributor

@filipoff2 i don't think this is a shell bug

I ran your code and the exception is happening here

            styleList.Add(styleAttributeInstance);
            dictionaryAdd.Invoke(styleProperties, new object[] { name, styleList });
        }

in your StyleSheet.cs class

I'm not sure what's all going on in there but if you could break that out into a smaller repro. Maybe this is an issue on your side? I see reflection so maybe it's triggering an unsupported scenario?

For fun I changed "add" to "tryadd" and then it loads

@PureWeen PureWeen added a/style s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. s/needs-repro ❔ This reported issue doesn't include a sample project reproducing the issue. Please provide one. labels Aug 13, 2020
@mgierlasinski
Copy link

@filipoff2 @PureWeen This is not an issue with Shell but with Magic Gradients and Brushes working together. In Forms 4.8 there was new background css property introduced, we use exact same property in Magic Gradients. We are working on fix, registering css properties outside Forms assembly is a reflection pain 😞 As @PureWeen pointed this is registration issue, if there is an existing background key, we should modify value instead of adding new entry.

See Bug report for details.

@filipoff2
Copy link
Author

Ok well I did update something was working after update not so conclusion was fast.

Registering css properties outside Forms assembly should be more formalized in such case.

@PureWeen @mgierlasinski is there an new feature request for formalize Registering css properties outside Forms?

@filipoff2
Copy link
Author

filipoff2 commented Aug 13, 2020

ok I'm closing issue.
This one is hobby for me.
For commercial projects: Less 3rd party nuggets are used in xamarin client solution than it is more chance it won't be hit by xamarin update, what happened to me few times.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/style s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. s/needs-repro ❔ This reported issue doesn't include a sample project reproducing the issue. Please provide one. s/unverified New report that has yet to be verified t/bug 🐛
Projects
None yet
Development

No branches or pull requests

3 participants