microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
111.33k stars 6.55k forks source link

System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. #5471

Closed up3ndra closed 4 years ago

up3ndra commented 4 years ago

##Problem

**

Cannot open power toys setting. It runs in the background but functions doesn't work.

**

## Log File

2020-08-02.txt

## ℹ Computer information

## Execption Message Version: 1.0.0 OS Version: Microsoft Windows NT 10.0.20180.0 IntPtr Length: 8 x64: True Date: 08/02/2020 09:34:43 Exception: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Could not load file or assembly 'Microsoft.PowerToys.Settings.UI.Lib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified. at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module) at System.Reflection.RuntimeModule.GetTypes() at System.Reflection.Assembly.GetTypes() at Wox.Core.Plugin.PluginsLoader.<>cDisplayClass2_1.b1() at Wox.Infrastructure.Stopwatch.Debug(String message, Action action) at Wox.Core.Plugin.PluginsLoader.CSharpPlugins(List1 source) at Wox.Core.Plugin.PluginsLoader.Plugins(List1 metadatas, PluginsSettings settings) at Wox.Core.Plugin.PluginManager.LoadPlugins(PluginsSettings settings) at PowerLauncher.App.<>cDisplayClass16_0.b1() at Wox.Infrastructure.Stopwatch.Normal(String message, Action action) at PowerLauncher.App.OnStartup(Object sender, StartupEventArgs e) at System.Windows.Application.OnStartup(StartupEventArgs e) at System.Windows.Application.<.ctor>b__1_0(Object unused) 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) System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.PowerToys.Settings.UI.Lib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified. File name: 'Microsoft.PowerToys.Settings.UI.Lib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'

OddSquirrel commented 4 years ago

I just had the same error that was caused by my anti-malware's behavior blocker, even though it was flagged as safe. You might want to reinstall PT with any such software turned off or paused during the installation.

enricogior commented 4 years ago

@up3ndra can you verify if you have the same problem with 0.20.1? https://github.com/microsoft/PowerToys/releases/tag/v0.20.1

@OddSquirrel what anti-malware software are you using?

up3ndra commented 4 years ago

@up3ndra can you verify if you have the same problem with 0.20.1? https://github.com/microsoft/PowerToys/releases/tag/v0.20.1

@OddSquirrel what anti-malware software are you using?

I'm using default windows security. I just removed old version and installed the new 0.20.1 with windows defender disabled. But still the same problem.

enricogior commented 4 years ago

@up3ndra the reported error is not clear, it shows an error loading the Settings and also loading PR Run. Can you provide more details on what exactly is happening? PT Run doesn't open and shows an error dialog? If you try to open the Settings, does an error appear or simply it doesn't work?

OddSquirrel commented 4 years ago

@OddSquirrel what anti-malware software are you using?

Sorry, I should have mentioned it. I'm using Emsisoft Enterprise Security.

ghost commented 4 years ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 5 days. It will be closed if no further activity occurs within 5 days of this comment.

crutkas commented 4 years ago

@ryanbodrug-microsoft / @enricogior something is causing an issue here as we're seeing it reported multiple times. Do we have any watson deeper dives here?

ghost commented 4 years ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 5 days. It will be closed if no further activity occurs within 5 days of this comment.

dsrivastavv commented 4 years ago

@up3ndra Could you please try the following steps and see if this fix your issue :

  1. Uninstall PowerToys.
  2. Ensure that C:\Program Files\PowerToys folder is deleted. If not, manually delete it.
  3. Install Powertoys Version=0.20.1

Please follow the below steps in case this still doesn't fix your issue :

  1. Upload log files located at %userprofile%/appdata/local/microsoft/powertoys/powertoys run/logs
  2. Upload PowerLauncher.deps.json located at C:\Program Files\PowerToys\modules\launcher.

@crutkas @ryanbodrug-microsoft The program is trying to load Version=1.0.0.0 of Microsoft.PowerToys.Settings.UI.Lib.dll but it should instead match PowerToys version after 0.19.0 release.

crutkas commented 4 years ago

What can we do to guard against this

crutkas commented 4 years ago

@enricogior just to verify, the exe installer will fully uninstall and delete the folder both in uninstall and upgrade. Correct?

If so, then we shouldn't have random MIA files?

enricogior commented 4 years ago

@crutkas yes, correct.

crutkas commented 4 years ago

Fixed in 0.23 of PowerToys. https://github.com/microsoft/PowerToys/releases/