private const string DllAssemblySuffix = ".dll";
+ private const string ExeAssemblySuffix = ".exe";
+
private const string NativeDllAssemblySuffix = NativeAssemblyInfix + DllAssemblySuffix;
- private static readonly string[] s_suffixes = new string[] { NativeDllAssemblySuffix, DllAssemblySuffix };
+ private static readonly string[] s_suffixes = new string[] { NativeDllAssemblySuffix, DllAssemblySuffix, ExeAssemblySuffix };
private SortedSet<string> _dllDirectories = new SortedSet<string>();
private SortedSet<string> _nativeDirectories = new SortedSet<string>();
- private HashSet<FileInfo> _dllCache = new HashSet<FileInfo>();
+ private HashSet<FileInfo> _assemblyCache = new HashSet<FileInfo>();
public AssemblyLoader()
{
{
var info = new FileInfo(file);
- if (info.Extension == DllAssemblySuffix)
+ if (s_suffixes.Contains(info.Extension))
{
- _dllCache.Add(info);
+ _assemblyCache.Add(info);
}
}
}
_dllDirectories.Remove(directory);
_nativeDirectories.Remove(directory);
- _dllCache.RemoveWhere(x => x.DirectoryName == directory);
+ _assemblyCache.RemoveWhere(x => x.DirectoryName == directory);
}
public Assembly LoadFromPath(string path)
{
foreach (string suffix in s_suffixes)
{
- var info = _dllCache.FirstOrDefault(x => x.Name == assemblyName.Name + suffix);
+ var info = _assemblyCache.FirstOrDefault(x => x.Name == assemblyName.Name + suffix);
if (info != null)
{