microsoft / microsoft/PowerToys

something went wrong

Open
#47,063 0 comments 0 reactions 0 assignees View on GitHub
Issue-Bug Needs-Triage Product-General
Dominant language
C
Stars
139k
Forks
8.6k
PR merge metrics
PR metrics pending

Description

### Microsoft PowerToys version

0.97.2.0

### Installation method

Microsoft Store

### Area(s) with issue?

General

### Steps to reproduce

Version: 0.97.2.0
OS Version: Microsoft Windows NT 10.0.19045.0
IntPtr Length: 8
x64: True
Date: 4/17/2026 1:40:31 PM
Exception:
System.InvalidCastException: Unable to cast object of type 'System.RuntimeType' to type 'System.Windows.Style'.
at System.Windows.FrameworkElement.OnStyleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue)
at System.Windows.ResourceReferenceExpression.InvalidateExpressionValue(Object sender, EventArgs e)
at System.Windows.TreeWalkHelper.InvalidateResourceReferences(DependencyObject d, ResourcesChangeInfo info)
at System.Windows.TreeWalkHelper.OnResourcesChanged(DependencyObject d, ResourcesChangeInfo info, Boolean raiseResourceChangedEvent)
at System.Windows.TreeWalkHelper.OnResourcesChangedCallback(DependencyObject d, ResourcesChangeInfo info, Boolean visitedViaVisualTree)
at System.Windows.DescendentsWalker`1.StartWalk(DependencyObject startNode, Boolean skipStartNode)
at System.Windows.TreeWalkHelper.InvalidateOnResourcesChange(FrameworkElement fe, FrameworkContentElement fce, ResourcesChangeInfo info)
at System.Windows.SystemResources.InvalidateTreeResources(Object args)
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

_No response_

### ❌ Actual Behavior

_No response_

### Upload Bug Report ZIP-file

_No response_

### Additional Information

_No response_

### Other Software

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure on Microsoft Windows 10 with PowerToys 0.97.2.0 installed from the Microsoft Store, then trace the System.Windows.FrameworkElement.OnStyleChanged call shown in the exception. Identify which PowerToys UI action or resource change triggers the InvalidCastException; done means the trigger is confirmed and the crash no longer occurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.