1
|
using ExtCore.Infrastructure;
|
2
|
using System;
|
3
|
using System.Collections.Generic;
|
4
|
using System.IO;
|
5
|
using System.Linq;
|
6
|
using System.Reflection;
|
7
|
using System.Text;
|
8
|
using System.Threading.Tasks;
|
9
|
|
10
|
namespace Leuze.Tests.Configuration
|
11
|
{
|
12
|
/// <summary>
|
13
|
///
|
14
|
/// </summary>
|
15
|
public class Utilities
|
16
|
{
|
17
|
/// <summary>
|
18
|
///
|
19
|
/// </summary>
|
20
|
public static void LoadExtensions()
|
21
|
{
|
22
|
List<Assembly> loadedAssemblies = new List<Assembly>();
|
23
|
|
24
|
// Loop through all dll files in directory
|
25
|
foreach (FileInfo file in new DirectoryInfo("C:\\Users\\domin\\source\\repos\\Leuze\\src\\Presentation\\Leuze.Modules\\net5.0").GetFiles("*.dll"))
|
26
|
{
|
27
|
try
|
28
|
{
|
29
|
loadedAssemblies.Add(Assembly.Load(AssemblyName.GetAssemblyName(file.FullName)));
|
30
|
}
|
31
|
catch (Exception)
|
32
|
{
|
33
|
Console.WriteLine("Error loading assembly from file: " + file.FullName);
|
34
|
}
|
35
|
}
|
36
|
|
37
|
ExtensionManager.SetAssemblies(loadedAssemblies);
|
38
|
}
|
39
|
}
|
40
|
}
|