microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
111.37k stars 6.56k forks source link

[PT Run] Plugin can not be loaded because 'Name' property is absent #10092

Closed rutalreja-deloitte closed 3 years ago

rutalreja-deloitte commented 3 years ago

Version: 0.33.1.0 OS Version: Microsoft Windows NT 10.0.19042.0 IntPtr Length: 8 x64: True Date: 3/6/2021 5:05:27 PM Exception: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Method 'get_Name' in type 'Microsoft.PowerToys.Run.Plugin.Registry.Main' from assembly 'Microsoft.PowerToys.Run.Plugin.Registry, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation. at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module) at System.Reflection.RuntimeModule.GetTypes() at System.Reflection.Assembly.GetTypes() at PowerLauncher.Plugin.PluginsLoader.<>cDisplayClass2_1.b__1() at Wox.Infrastructure.Stopwatch.Debug(String message, Action action) at PowerLauncher.Plugin.PluginsLoader.CSharpPlugins(List1 source) at PowerLauncher.Plugin.PluginsLoader.Plugins(List1 metadatas) at PowerLauncher.Plugin.PluginManager.get_AllPlugins() at PowerLauncher.Plugin.PluginManager.GetPluginsForInterface[T]() at PowerLauncher.ViewModel.MainViewModel.RegisterResultsUpdatedEvent() at PowerLauncher.ViewModel.MainViewModel..ctor(PowerToysRunSettings settings) at PowerLauncher.App.<>cDisplayClass14_0.b0() 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>b1_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.TypeLoadException: Method 'get_Name' in type 'Microsoft.PowerToys.Run.Plugin.Registry.Main' from assembly 'Microsoft.PowerToys.Run.Plugin.Registry, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.

mykhailopylyp commented 3 years ago

@rutalreja-deloitte Can you restart PowerToys and check if it still reproduces? If it still reproduces restart your machine and check if it still reproduces.

rutalreja-deloitte commented 3 years ago

It did persist, I have already uninstalled and reverted to the previous version, I can give it another try in the evening

mykhailopylyp commented 3 years ago

Can you provide a bug report? In the tray menu, right-click on the PowerToys icon. image

Drag and drop file named like PowerToysReport_2021-03-08-18-36-50.zip into github comment.

mykhailopylyp commented 3 years ago

@rutalreja-deloitte Go to C:\Program Files\PowerToys\modules\launcher\Plugins\Microsoft.PowerToys.Run.Plugin.Registry. Open properties for Microsoft.PowerToys.Run.Plugin.Registry.dll and check if Timestamp is the same as on the screenshot below. image

ghost commented 3 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 3 years ago

@mykhailopylyp we've seen multiple reports here. What is the theory.

mykhailopylyp commented 3 years ago

@crutkas We added Name property to IPlugin interface and implemented it for all plugins in 0.33.1. From the bug report above we can see that the Name property is absent. We suspect .NET Core has a cached version of the dll. Since the dll is built with a static 1.0.0.0 version number, that is a possibility. For sure we want to fix the build process to use the correct version number. In 0.35 we will see if fixing the version number is fixing the problem.

enricogior commented 3 years ago

@crutkas we should fix the static version number even if it's not the cause of this bug. At least we will be sure that it's not the cause of the problem if in 0.35 the crash will still happen.

crutkas commented 3 years ago

@enricogior / @mykhailopylyp , why haven't any of us seeing the crash? shouldn't this have failed pretty much asap? I can totally see the versioning be an issue but surprised we didn't see it on our computers

enricogior commented 3 years ago

@crutkas right now it's still a wild guess that .NET Core caches the previously installed dll. And it that is the problem, we don't know if it's a bug in .NET or a feature. To try to replicate it, you have to first install 0.31 on a machine that never had 0.33 running, otherwise the bug might never happen, use the Registry plugin and then update to 0.33.

htcfreek commented 3 years ago

With the pr we changed the project/file version. But now file version is different to plugin version in json. - Can be confusing.

enricogior commented 3 years ago

@htcfreek good point. I would guess it can be removed from the json. Do you mind opening an issue to discuss in details? Thanks.

htcfreek commented 3 years ago

@htcfreek good point. I would guess it can be removed from the json. Do you mind opening an issue to discuss in details? Thanks.

I can do this the next days.

Do we show the version in plugin manager?

enricogior commented 3 years ago

@htcfreek

Do we show the version in plugin manager?

No.

enricogior commented 3 years ago

Labelling this as fix committed since https://github.com/microsoft/PowerToys/pull/10314 should resolve this.

ghost commented 3 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.

htcfreek commented 3 years ago

cc: @enricogior Can we block bot on this issue?

crutkas commented 3 years ago

This has been resolved in the 0.35 release. https://github.com/microsoft/PowerToys/releases/latest