diff --git a/Core/Core.cs b/Core/Core.cs
index d733d09..b7b9a4d 100644
--- a/Core/Core.cs
+++ b/Core/Core.cs
@@ -62,6 +62,13 @@ namespace Kruzya.TelegramBot.Core
}
}
+ ///
+ /// List of filenames (without extension) what should be not loaded.
+ ///
+ private List _ignoredAssemblyFilenames => _configuration
+ .GetSection("IgnoredModuleFilenames").GetChildren()
+ .Select(q => q.Value).ToList();
+
#endregion
public Core(IConfiguration configuration)
@@ -111,6 +118,12 @@ namespace Kruzya.TelegramBot.Core
/// if success, null otherwise.
private IEnumerable? LoadAssembly(string path)
{
+ var fileName = Path.GetFileNameWithoutExtension(path).ToString();
+ if (_ignoredAssemblyFilenames.Contains(fileName))
+ {
+ return null;
+ }
+
Assembly assembly;
try
{