-
-
Notifications
You must be signed in to change notification settings - Fork 230
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
[Question] Accessing app.config from a plugin #254
Comments
Have you tried using GetExecutingAssembly?
|
No, because I ended up storing the path of the dll in my plugin discovery mechanism. |
I am currently using it and it works for me |
This issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please comment if you believe this should remain open, otherwise it will be closed in 14 days. Thank you for your contributions to this project. |
I'm not aware of any mechanism we can use to set the The base class we use in .NET to extend assembly loading is https://learn.microsoft.com/en-us/dotnet/api/system.runtime.loader.assemblyloadcontext. If there is something we have missed in how its implement that would help here, let me know. Otherwise, I don't know if there is anything we can change in our library to fix this for you. |
I'm returning to your plugin package for my plugins because I want to implement plugin reloading.
All my plugins have a config file, an ap.config that gets build with the plugin and that contains settings. Every plugin has an
Initialize
method, which inside the plugin performs this code to fetch the right app.config:I've been using the native plugin loading mechanism of .NET Core 3.1+ before (and similar approach for the old .NET framework) where this works fine. However, if I make plugins unloadable,
this.GetType().Assembly.Location
for each plugin is null.this.GetType().Assembly.CodeBase
is does have a value, but it is: file:///C:/Program Files (x86)/dotnet/shared/Microsoft.NETCore.App/6.0.6/System.Private.CoreLib.dll.Is there any way to get the
Location
property filled for the plugin assembly?The text was updated successfully, but these errors were encountered: