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] System.IO.FileNotFoundException: Could not load file or assembly 'System.Windows.Controls.Ribbon' #9619

Closed
Synertry opened this issue Feb 10, 2021 · 23 comments
Assignees
Labels
Issue-Bug Something isn't working Needs-Repro We can't figure out how to make this happen. Please help find a simplified repro. 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

@Synertry
Copy link

2021-02-10.txt

ℹ Computer information

  • PowerToys version: 0.31.1.0
  • PowerToy Utility: PowerToys Run
  • Running PowerToys as Admin: Yes
  • Windows build number: 19042.789

📝 Provide detailed reproduction steps (if any)

  1. I opened Windows Explorer
  2. I pressed ALT+Space

✔️ Expected result

Popping up PowerToys run

❌ Actual result

Error console

📷 Screenshots

image

@Synertry Synertry added Issue-Bug Something isn't working Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Feb 10, 2021
@Synertry
Copy link
Author

Closing PowerToys and restarting it fixed this.
So not important, but I just wanted to file this bug as it was suggested.

@mykhailopylyp mykhailopylyp added the Product-PowerToys Run Improved app launch PT Run (Win+R) Window label Feb 10, 2021
@crutkas
Copy link
Member

crutkas commented Feb 10, 2021

This is odd as that name space is WinForms?!?


System.IO.FileNotFoundException: Could not load file or assembly 'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Das System kann die angegebene Datei nicht finden.
   Source: PowerLauncher
   TargetAssembly: PowerLauncher, Version=0.31.1.0, Culture=neutral, PublicKeyToken=null
   TargetModule: PowerLauncher.dll
   TargetSite: Double WindowTop()
   at PowerLauncher.MainWindow.WindowTop()
   at PowerLauncher.MainWindow.InitializePosition()
   at PowerLauncher.MainWindow.OnLoaded(Object sender, RoutedEventArgs e)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
   at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
   at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root)
   at MS.Internal.LoadedOrUnloadedOperation.DoWork()
   at System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()
   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.Resize(ICompositionTarget resizedCompositionTarget)
   at System.Windows.Interop.HwndTarget.OnResize()
   at System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(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)

second callstack

System.IO.FileNotFoundException: Could not load file or assembly 'System.Text.Encoding.CodePages, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Das System kann die angegebene Datei nicht finden.
   Source: PresentationFramework
   TargetAssembly: PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
   TargetModule: PresentationFramework.dll
   TargetSite: Void .cctor()
   at MS.Internal.Text.InternalEncoding..cctor()

System.TypeInitializationException: The type initializer for 'MS.Internal.Text.InternalEncoding' threw an exception.
   Source: PresentationFramework
   TargetAssembly: PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
   TargetModule: PresentationFramework.dll
   TargetSite: Void ComputePreferredCodePage()
   at System.Windows.Documents.FontTableEntry.ComputePreferredCodePage()
   at System.Windows.Documents.XamlToRtfWriter..ctor(String xaml)
   at System.Windows.Documents.XamlRtfConverter.ConvertXamlToRtf(String xamlContent)
   at System.Windows.Documents.TextEditorCopyPaste.ConvertXamlToRtf(String xamlContent, Stream wpfContainerMemory)
   at System.Windows.Documents.TextEditorCopyPaste._CreateDataObject(TextEditor This, Boolean isDragDrop)
   at System.Windows.Documents.TextEditorCopyPaste.Copy(TextEditor This, Boolean userInitiated)
   at System.Windows.Documents.TextEditorCopyPaste.OnCopy(Object target, ExecutedRoutedEventArgs args)
   at System.Windows.Input.CommandBinding.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
   at System.Windows.Input.CommandManager.FindCommandBinding(Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
   at System.Windows.Input.CommandManager.OnExecuted(Object sender, ExecutedRoutedEventArgs 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.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.Input.RoutedCommand.ExecuteImpl(Object parameter, IInputElement target, Boolean userInitiated)
   at System.Windows.Input.CommandManager.TranslateInput(IInputElement targetElement, InputEventArgs inputEventArgs)
   at System.Windows.UIElement.OnKeyDownThunk(Object sender, KeyEventArgs 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.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndKeyboardInputProvider.ProcessKeyAction(MSG& msg, Boolean& handled)
   at System.Windows.Interop.HwndSource.CriticalTranslateAccelerator(MSG& msg, ModifierKeys modifiers)
   at System.Windows.Interop.HwndSource.OnPreprocessMessage(Object param)
   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)

@ramonsmits
Copy link

ramonsmits commented Feb 11, 2021

Same problem,

windows: 10 20H2
version: 0.31.2

@enricogior
Copy link
Contributor

@ramonsmits
are you also running PowerToys on German locale?

@ramonsmits
Copy link

@enricogior No I'm not, I'm running Windows in en-US with Dutch formatting.

It is now working again without issues.

@crutkas
Copy link
Member

crutkas commented Feb 16, 2021

@enricogior, #9734 has same WindowTop error in the logs

@crutkas
Copy link
Member

crutkas commented Feb 16, 2021

Actually, looking at this log and from #9734 i think we're trying to load an image that isn't there and that is what is actually failing.

This log shows files from a file server and the other one was from onedrive, who's lnk may not be downloaded.

@crutkas crutkas added Severity-High Bugs that we consider a blocking issue for release (crashes stuff outside of PT) and removed Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Feb 16, 2021
@crutkas crutkas added this to the 2020 Stability Release milestone Feb 16, 2021
@crutkas crutkas added this to To do in 0.35 Release via automation Feb 16, 2021
@JoshKeegan
Copy link

I seem to be having the same problem (or at least similar):
2021-02-23.txt

@enricogior enricogior changed the title System.IO.FileNotFoundException: Could not load file or assembly 'System.Windows.Controls.Ribbon, Culture=neutral, PublicKeyToken=b77a5c561934e089'. [Run] System.IO.FileNotFoundException: Could not load file or assembly 'System.Windows.Controls.Ribbon' Mar 8, 2021
@yuyoyuppe yuyoyuppe self-assigned this Mar 23, 2021
@yuyoyuppe yuyoyuppe added the Status-In progress This issue or work-item is under development label Mar 23, 2021
@yuyoyuppe
Copy link
Collaborator

If we look at the WindowTop function where the crash happens, we see that it only calls GetScreen before doing some math. There, we see that we use things from Screen, which is an alias to that dll

using Screen = System.Windows.Forms.Screen;

So, as I understand, since we don't do any I/O there, dotnet runtlme tries to load the dll, and only does that when that code is executed, and cannot find it for some reason.

@enricogior enricogior added this to To do in 0.39 release via automation Mar 29, 2021
@enricogior enricogior removed this from To do in 0.35 Release Mar 29, 2021
@enricogior enricogior removed the Status-In progress This issue or work-item is under development label Mar 29, 2021
@enricogior
Copy link
Contributor

The initial investigation showed this may be a runtime bug, moving to 0.39.

0.41 Release automation moved this from To do to In progress Jun 10, 2021
@crutkas
Copy link
Member

crutkas commented Jun 10, 2021

@yuyoyuppe / @mykhailopylyp this error happens a ton, this shouldn't be closed out as can't repro

This was referenced Jun 10, 2021
@yuyoyuppe
Copy link
Collaborator

As I understand, that would be solved by migration to dotnet 5?

@crutkas
Copy link
Member

crutkas commented Jun 14, 2021

it is theory

@crutkas crutkas mentioned this issue Jun 15, 2021
1 task
@crutkas crutkas added the Status-In progress This issue or work-item is under development label Jun 22, 2021
@yuyoyuppe
Copy link
Collaborator

We need to investigate how .NET applications resolve their required DLLs, and add some diagnostic logic to check whether the DLLs are actually present.

@dedavis6797
Copy link
Contributor

How's this coming along? Appears we've had this in progress since June.

@dedavis6797 dedavis6797 removed this from To do in 0.43 Release Aug 9, 2021
@dedavis6797 dedavis6797 added this to To do in 0.45 Release via automation Aug 9, 2021
@yuyoyuppe yuyoyuppe removed the Status-In progress This issue or work-item is under development label Aug 9, 2021
@yuyoyuppe
Copy link
Collaborator

I think this might be caused by the same issue as #12354.

@jaimecbernardo
Copy link
Collaborator

@Synertry , Could you please check if you still have this issue on 0.43?

@jaimecbernardo jaimecbernardo added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Aug 10, 2021
@Synertry
Copy link
Author

This was a one-time experience for me.
I am running version 0.43 on 3 devices with daily use of the Run function.
Can't repro

@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 Aug 10, 2021
@dedavis6797
Copy link
Contributor

Per the comment: #12354 (comment), marking this as fix-committed unless the issue resurfaces in 0.43.

@dedavis6797 dedavis6797 added Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed 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 labels Aug 12, 2021
@dedavis6797 dedavis6797 moved this from To do to Done in 0.45 Release Aug 12, 2021
@dedavis6797
Copy link
Contributor

Resolved with the release of v0.45.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug Something isn't working Needs-Repro We can't figure out how to make this happen. Please help find a simplified repro. 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
No open projects
Development

No branches or pull requests

9 participants