PluginLoader: load only files with DLL extension from directories and zips
I had several Xy.dll.xml files there and it was tried to be loaded as an Assembly.
This commit is contained in:
@@ -232,7 +232,7 @@ namespace Torch.Managers
|
||||
|
||||
foreach (var file in files)
|
||||
{
|
||||
if (!file.Contains(".dll", StringComparison.CurrentCultureIgnoreCase))
|
||||
if (!file.EndsWith(".dll", StringComparison.CurrentCultureIgnoreCase))
|
||||
continue;
|
||||
|
||||
using (var stream = File.OpenRead(file))
|
||||
@@ -263,7 +263,7 @@ namespace Torch.Managers
|
||||
|
||||
foreach (var entry in zipFile.Entries)
|
||||
{
|
||||
if (!entry.Name.Contains(".dll", StringComparison.CurrentCultureIgnoreCase))
|
||||
if (!entry.Name.EndsWith(".dll", StringComparison.CurrentCultureIgnoreCase))
|
||||
continue;
|
||||
|
||||
using (var stream = entry.Open())
|
||||
|
Reference in New Issue
Block a user