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

Plugin Does not Load when has Dependent Dlls #35295

Open
dnldpavlik opened this issue Oct 7, 2024 · 3 comments
Open

Plugin Does not Load when has Dependent Dlls #35295

dnldpavlik opened this issue Oct 7, 2024 · 3 comments
Labels
Issue-Bug Something isn't working 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

Comments

@dnldpavlik
Copy link

Microsoft PowerToys version

0.85.1

Installation method

PowerToys auto-update

Running as admin

No

Area(s) with issue?

PowerToys Run

Steps to reproduce

Build a Plugin for PowerToys Run, and have a 3rd party Dll or another Class DLL Library project for Plugin, build and copy to plug in folder.

Because of this limitation, I have to copy and paste a dll library that I am sharing between two projects that defines my domain model. If this is possible, where do I need to have these other dlls loaded so that it can be found, as I had tried the plugin directory where the plugin build output is, and the root of the PowerToys application where the exe is.

✔️ Expected Behavior

The Plug in Loads

❌ Actual Behavior

You will receive an error stating that the plug in could not be instantiated because one of the its dependencies could not be loaded.

Other Software

No response

@dnldpavlik dnldpavlik added Issue-Bug Something isn't working Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Oct 7, 2024
@davidegiacometti
Copy link
Collaborator

davidegiacometti commented Oct 7, 2024

Hi @dnldpavlik

Have you tried setting "DynamicLoading": true in plugin.json?
https://github.com/microsoft/PowerToys/blob/main/doc/devdocs/modules/launcher/new-plugin-checklist.md

/needinfo

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Oct 7, 2024
@dnldpavlik
Copy link
Author

I just did, and I get the error fail to load and would be disabled, please contact plugins creator for help.

I will pull down the source of powertoys to see where it is failing and update.

@microsoft-github-policy-service microsoft-github-policy-service bot 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 Oct 7, 2024
@dnldpavlik
Copy link
Author

This line in the PluginPair.cs is currently where it is throwing an error saying it can not find the plugin that matches, yet it found it before I used the dynamic setting, and when I run the same code in the immediate window it finds the class that matches. So I am not sure why it is failing the first time.

type = types.First(o => o.IsClass && !o.IsAbstract && o.GetInterfaces().Contains(typeof(IPlugin)));

The odd thing is that before I set the type of dynamic to true, it found it with no issue except for when I had another class dll being referenced for the plugin.

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-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
Projects
Status: No status
Development

No branches or pull requests

2 participants