-
-
Notifications
You must be signed in to change notification settings - Fork 797
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
Adds the ability to create external plugins #733
Conversation
if (!allowNull) | ||
var baseDir = AppDomain.CurrentDomain.BaseDirectory; | ||
string[] extensions = { ".dll" }; | ||
var allFiles = Directory.EnumerateFileSystemEntries(baseDir, "*.*") |
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.
Why not filter by *.dll instead of this construction?
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.
Good point, I'll update!
var allFiles = Directory.EnumerateFileSystemEntries(baseDir, "*.*") | ||
.Where(x => extensions.Any(ext => ext == Path.GetExtension(x))); | ||
var assemblies = new List<Assembly> { Assembly.GetExecutingAssembly() }; | ||
assemblies.AddRange(allFiles.Select(AssemblyName.GetAssemblyName).Select(Assembly.Load)); |
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.
Maybe add some try-catch with a Log.Warn if it fails to load? (Not sure if the logger is available at this point)
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.
Yep, agreed, couldn't figure out how to get the logger, but I'll look into it again.
@WouterTinus Thanks for the review, this is now updated:
|
Thanks for the update! |
See issue #732