-
Notifications
You must be signed in to change notification settings - Fork 1k
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 dll load method change. (2x) #810
Plugin dll load method change. (2x) #810
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please wait until I test this.
Versions of neo-plugins are latests neo-plugins are different, 2.10.2.0 and 2.10.2.1. Fell free to merge @shargon , we need another PR for extra adjustments, maybe neocli should optionally read both: plugin name and, optionally, version |
@@ -97,7 +97,8 @@ internal static void LoadPlugins(NeoSystem system) | |||
if (!Directory.Exists(pluginsPath)) return; | |||
foreach (string filename in Directory.EnumerateFiles(pluginsPath, "*.dll", SearchOption.TopDirectoryOnly)) | |||
{ | |||
Assembly assembly = Assembly.LoadFile(filename); | |||
var file = File.ReadAllBytes(filename); | |||
Assembly assembly = Assembly.Load(file); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very interesting solution... since sizes are very low, it shouldn't impact memory.
@Ashuaidehao, could you port this to master branch? |
Sure ,I have created another PR(#816) port to master branch. |
* [EN] Sync up with neo-project#809 [EN] Sync up with neo-project#809 * minor update * fix some
Currently neo load plugin dll file directly, which will lock dll files and result in "uninstall" command fails.
So I change load method to load a copied dll file to resolve this issue.