Skip to content
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

[Run] XamlParseException: Set property 'System.Windows.ResourceDictionary.DeferrableContent' threw an exception #36389

Open
CaleClink opened this issue Dec 17, 2024 · 11 comments
Labels
External Dependency This bug or feature isn't resolved, but it's following an external work item. Issue-Bug Something isn't working Priority-0 Bugs that we consider release-blocking/recall-class (P0) Product-PowerToys Run Improved app launch PT Run (Win+R) Window Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release. Severity-High Bugs that we consider a blocking issue for release (crashes stuff outside of PT)

Comments

@CaleClink
Copy link

Microsoft PowerToys version

.0.87.0.0

Installation method

GitHub

Running as admin

No

Area(s) with issue?

General

Steps to reproduce

Version: 0.87.0.0
OS Version: Microsoft Windows NT 10.0.26100.0
IntPtr Length: 8
x64: True
Date: 17-Dec-24 9:13:25 AM
Exception:
System.Windows.Markup.XamlParseException: Set property 'System.Windows.ResourceDictionary.DeferrableContent' threw an exception.
---> System.ArgumentException: Item has already been added. Key in dictionary: 'SystemColorWindowColorBrush' Key being added: 'SystemColorWindowColorBrush'
at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
at System.Windows.ResourceDictionary.SetKeys(IList`1 keyCollection, IServiceProvider serviceProvider)
at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, Object value)
--- End of inner exception stack trace ---
at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri)
at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc)
at MS.Internal.AppModel.AppModelKnownContentFactory.BamlConverterCore(Stream stream, Uri baseUri, Boolean canUseTopLevelBrowser, Boolean sandboxExternalContent, Boolean allowAsync, Boolean isJournalNavigation, XamlReader& asyncObjectConverter, Boolean isUnsafe)
at MS.Internal.AppModel.MimeObjectFactory.GetObjectAndCloseStreamCore(Stream s, ContentType contentType, Uri baseUri, Boolean canUseTopLevelBrowser, Boolean sandboxExternalContent, Boolean allowAsync, Boolean isJournalNavigation, XamlReader& asyncObjectConverter, Boolean isUnsafe)
at System.Windows.ResourceDictionary.set_Source(Uri value)
at System.Windows.ThemeManager.GetThemeDictionary(ThemeMode themeMode)
at System.Windows.ThemeManager.ApplyFluentOnWindow(Window window)
at System.Windows.ThemeManager.OnWindowThemeChanged(Window window, ThemeMode oldThemeMode, ThemeMode newThemeMode)
at System.Windows.Window.CreateSourceWindow(Boolean duringShow)
at System.Windows.Window.ShowHelper(Object booleanBox)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

✔️ Expected Behavior

Version: 0.87.0.0
OS Version: Microsoft Windows NT 10.0.26100.0
IntPtr Length: 8
x64: True
Date: 17-Dec-24 9:13:25 AM
Exception:
System.Windows.Markup.XamlParseException: Set property 'System.Windows.ResourceDictionary.DeferrableContent' threw an exception.
---> System.ArgumentException: Item has already been added. Key in dictionary: 'SystemColorWindowColorBrush' Key being added: 'SystemColorWindowColorBrush'
at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
at System.Windows.ResourceDictionary.SetKeys(IList`1 keyCollection, IServiceProvider serviceProvider)
at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, Object value)
--- End of inner exception stack trace ---
at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri)
at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc)
at MS.Internal.AppModel.AppModelKnownContentFactory.BamlConverterCore(Stream stream, Uri baseUri, Boolean canUseTopLevelBrowser, Boolean sandboxExternalContent, Boolean allowAsync, Boolean isJournalNavigation, XamlReader& asyncObjectConverter, Boolean isUnsafe)
at MS.Internal.AppModel.MimeObjectFactory.GetObjectAndCloseStreamCore(Stream s, ContentType contentType, Uri baseUri, Boolean canUseTopLevelBrowser, Boolean sandboxExternalContent, Boolean allowAsync, Boolean isJournalNavigation, XamlReader& asyncObjectConverter, Boolean isUnsafe)
at System.Windows.ResourceDictionary.set_Source(Uri value)
at System.Windows.ThemeManager.GetThemeDictionary(ThemeMode themeMode)
at System.Windows.ThemeManager.ApplyFluentOnWindow(Window window)
at System.Windows.ThemeManager.OnWindowThemeChanged(Window window, ThemeMode oldThemeMode, ThemeMode newThemeMode)
at System.Windows.Window.CreateSourceWindow(Boolean duringShow)
at System.Windows.Window.ShowHelper(Object booleanBox)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

❌ Actual Behavior

Version: 0.87.0.0
OS Version: Microsoft Windows NT 10.0.26100.0
IntPtr Length: 8
x64: True
Date: 17-Dec-24 9:13:25 AM
Exception:
System.Windows.Markup.XamlParseException: Set property 'System.Windows.ResourceDictionary.DeferrableContent' threw an exception.
---> System.ArgumentException: Item has already been added. Key in dictionary: 'SystemColorWindowColorBrush' Key being added: 'SystemColorWindowColorBrush'
at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
at System.Windows.ResourceDictionary.SetKeys(IList`1 keyCollection, IServiceProvider serviceProvider)
at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, Object value)
--- End of inner exception stack trace ---
at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri)
at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc)
at MS.Internal.AppModel.AppModelKnownContentFactory.BamlConverterCore(Stream stream, Uri baseUri, Boolean canUseTopLevelBrowser, Boolean sandboxExternalContent, Boolean allowAsync, Boolean isJournalNavigation, XamlReader& asyncObjectConverter, Boolean isUnsafe)
at MS.Internal.AppModel.MimeObjectFactory.GetObjectAndCloseStreamCore(Stream s, ContentType contentType, Uri baseUri, Boolean canUseTopLevelBrowser, Boolean sandboxExternalContent, Boolean allowAsync, Boolean isJournalNavigation, XamlReader& asyncObjectConverter, Boolean isUnsafe)
at System.Windows.ResourceDictionary.set_Source(Uri value)
at System.Windows.ThemeManager.GetThemeDictionary(ThemeMode themeMode)
at System.Windows.ThemeManager.ApplyFluentOnWindow(Window window)
at System.Windows.ThemeManager.OnWindowThemeChanged(Window window, ThemeMode oldThemeMode, ThemeMode newThemeMode)
at System.Windows.Window.CreateSourceWindow(Boolean duringShow)
at System.Windows.Window.ShowHelper(Object booleanBox)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

Other Software

No response

@CaleClink CaleClink added Issue-Bug Something isn't working Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Dec 17, 2024
@jaimecbernardo
Copy link
Collaborator

What utility showed this error? Can you please send a /bugreport?

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Dec 17, 2024
@mantaionut
Copy link
Contributor

mantaionut commented Dec 17, 2024

@CaleClink did this crash happened when you switched to high contrast or how can this be reproduced?

@jaimecbernardo jaimecbernardo added the Product-PowerToys Run Improved app launch PT Run (Win+R) Window label Dec 17, 2024
This was referenced Dec 18, 2024
@t-clement1
Copy link

Having been marked as a duplicate, and as OP hasn't replied, here is my bug report.
I am indeed using high-contrast mode.

PowerToysReport_2024-12-19-14-31-40.zip

@mantaionut
Copy link
Contributor

@t-clement1 is this crash 100% for you when you are in high contrast or does this crash happen when you switch to it?

@t-clement1
Copy link

It happens at random intervals when in HC mode, and happens with almost 100% probability when switching to HC mode, or when switching between different HC mode colour presets.

@t-clement1
Copy link

Still throwing errors every day when booting, or changing themes related settings. PowerToys Run is literally unusable as is.

@crutkas crutkas added this to the PowerToys 0.88 milestone Dec 27, 2024
@crutkas crutkas added Priority-0 Bugs that we consider release-blocking/recall-class (P0) and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Dec 27, 2024
This was referenced Dec 28, 2024
@justFleyd
Copy link

i use win11 darkmode and the setting dark in "PT Run" then sometimes also use the high contrast mode on top for a darker event viewer and old settings and happens in the second when i switch to High Contrast mode (shift+Windows+print)

it spits exactly the same Error 2 times (2 windows) in the moment of switching

Version: 0.87.1.0
OS Version: Microsoft Windows NT 10.0.22631.0
IntPtr Length: 8
x64: True
Date: 03.01.2025 01:17:40
Exception:
System.Windows.Markup.XamlParseException: Set property 'System.Windows.ResourceDictionary.DeferrableContent' threw an exception.
---> System.ArgumentException: Item has already been added. Key in dictionary: 'SystemColorWindowColorBrush' Key being added: 'SystemColorWindowColorBrush'
at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
at System.Windows.ResourceDictionary.SetKeys(IList`1 keyCollection, IServiceProvider serviceProvider)
at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, Object value)
--- End of inner exception stack trace ---
at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri)
at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc)
at MS.Internal.AppModel.AppModelKnownContentFactory.BamlConverterCore(Stream stream, Uri baseUri, Boolean canUseTopLevelBrowser, Boolean sandboxExternalContent, Boolean allowAsync, Boolean isJournalNavigation, XamlReader& asyncObjectConverter, Boolean isUnsafe)
at MS.Internal.AppModel.MimeObjectFactory.GetObjectAndCloseStreamCore(Stream s, ContentType contentType, Uri baseUri, Boolean canUseTopLevelBrowser, Boolean sandboxExternalContent, Boolean allowAsync, Boolean isJournalNavigation, XamlReader& asyncObjectConverter, Boolean isUnsafe)
at System.Windows.ResourceDictionary.set_Source(Uri value)
at System.Windows.ThemeManager.GetThemeDictionary(ThemeMode themeMode)
at System.Windows.ThemeManager.ApplyFluentOnWindow(Window window)
at System.Windows.ThemeManager.OnSystemThemeChanged()
at System.Windows.SystemResources.SystemThemeFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

@mantaionut
Copy link
Contributor

@justFleyd are you using a custom high-contrast theme or one of the defaults?

@Christopher-James-Francis-Rodgers
Copy link

Christopher-James-Francis-Rodgers commented Jan 3, 2025

"Power Toys Run ran into an issue" - "Something went wrong".

This error occurs every time I switch to, or switch from my custom Windows 10 'High contrast' theme.

This error does 'Not' occur with any of the four 'default' (out of the box) Windows 10 'High contrast' themes.

See attached:

*.theme file (.txt extension added),

*.deskthemepack file (converted to *.zip),

*.png image file,

error message *.txt file,

and error log *.txt file.


''BNoSa Wrr.theme'' .txt

BNoSa Wrrow 2024.12.06.deskthemepack .zip

Image

Something went wrong.txt

PowerToys Run -- Logs -- 2025-01-03.txt

END

@jaimecbernardo jaimecbernardo added the External Dependency This bug or feature isn't resolved, but it's following an external work item. label Jan 6, 2025
@mantaionut
Copy link
Contributor

This issue will be fixed when .net gets released which will include this fix dotnet/wpf#10043.

@dipeshmsft
Copy link
Member

This issue will be fixed when .net gets released which will include this fix dotnet/wpf#10043.

@mantaionut , the new SDK is released with the fix for this issue.

@jaimecbernardo jaimecbernardo added the Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release. label Jan 17, 2025
This was referenced Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
External Dependency This bug or feature isn't resolved, but it's following an external work item. Issue-Bug Something isn't working Priority-0 Bugs that we consider release-blocking/recall-class (P0) Product-PowerToys Run Improved app launch PT Run (Win+R) Window Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release. Severity-High Bugs that we consider a blocking issue for release (crashes stuff outside of PT)
Projects
None yet
Development

No branches or pull requests

9 participants