Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[PT Run] System.InvalidCastException: Unable to cast object of type 'System.Windows.Documents.Run' to type 'System.Windows.FrameworkElement'. #11898

Closed
1 task
lsaudon opened this issue Jun 28, 2021 · 14 comments · Fixed by #11968
Labels
Hot Fix Items we will product an out-of-band release for 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

@lsaudon
Copy link

lsaudon commented Jun 28, 2021

Microsoft PowerToys version

"0.41.2.0"

Running as admin

  • Yes

Area(s) with issue?

PowerToys Run

Steps to reproduce

Open Visual Studio Code with PowerToys Run

✔️ Expected Behavior

Open Visual Studio Code

❌ Actual Behavior

Version: 0.41.2.0
OS Version: Microsoft Windows NT 10.0.19043.0
IntPtr Length: 8
x64: True
Date: 28/06/2021 22:32:02
Exception:
System.InvalidCastException: Unable to cast object of type 'System.Windows.Documents.Run' to type 'System.Windows.FrameworkElement'.
   at PowerLauncher.MainWindow.SuggestionsList_PreviewMouseLeftButtonUp(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   at System.Windows.UIElement.OnPreviewMouseUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.ContentElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   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

Visual Studio Code 1.57.1

@lsaudon lsaudon added Issue-Bug Something isn't working Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Jun 28, 2021
@samarmohan
Copy link

I can't reproduce this.

@mykhailopylyp
Copy link
Contributor

@lsaudon
Can it be reproduced all the time?

@mykhailopylyp mykhailopylyp added Product-PowerToys Run Improved app launch PT Run (Win+R) Window and removed Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Jun 29, 2021
@mykhailopylyp
Copy link
Contributor

Right-click on the PowerToys icon in the tray menu and select Report Bug
image
Drag and drop report into a GitHub comment.

@mykhailopylyp mykhailopylyp added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Jun 29, 2021
@lsaudon
Copy link
Author

lsaudon commented Jun 29, 2021

@lsaudon
Can it be reproduced all the time?

No, I can't reproduce.
It was the first time I used

PowerToysReport_2021-06-29-13-03-22.zip

@ghost ghost added Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams Needs-Team-Response An issue author responded so the team needs to follow up and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Jun 29, 2021
@mykhailopylyp mykhailopylyp removed Needs-Team-Response An issue author responded so the team needs to follow up Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Jun 29, 2021
@mykhailopylyp
Copy link
Contributor

@lsaudon
Thank you for following up!
Let us know if it happens again.

@dedavis6797 dedavis6797 added Priority-0 Bugs that we consider release-blocking/recall-class (P0) Severity-High Bugs that we consider a blocking issue for release (crashes stuff outside of PT) labels Jun 29, 2021
@dedavis6797 dedavis6797 changed the title Can't open visual studio code [PT Run] System.InvalidCastException: Unable to cast object of type 'System.Windows.Documents.Run' to type 'System.Windows.FrameworkElement'. Jun 29, 2021
@whawn1
Copy link

whawn1 commented Jun 29, 2021

Same here. Attempted to open Notepad++
Error msg -- "Something Went Wrong"
---begins---
Version: 0.41.2.0
OS Version: Microsoft Windows NT 10.0.19042.0
IntPtr Length: 8
x64: True
Date: 6/29/2021 3:12:59 PM
Exception:
System.InvalidCastException: Unable to cast object of type 'System.Windows.Documents.Run' to type 'System.Windows.FrameworkElement'.
at PowerLauncher.MainWindow.SuggestionsList_PreviewMouseLeftButtonUp(Object sender, MouseButtonEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.ContentElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
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)

--ends--
log attached
2021-06-29.txt

@dzigner
Copy link

dzigner commented Jun 29, 2021

I opened another issue same as this, here.
I wanted to add one thing to the original issue:
I was trying to open an app, and got this error.
I opened the spotlight search again, and tried to open the same app, it opened without errors.
So I tried this with another app, and same thing happened - first time, it gave error, second time, it opened the app without any problems.

@dedavis6797 dedavis6797 unpinned this issue Jul 8, 2021
This was referenced Jul 19, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Hot Fix Items we will product an out-of-band release for 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

Successfully merging a pull request may close this issue.