C# reflection – load assembly and invoke a method if it exists
Since this seems to be a popular question, here’s the complete source code example on how to do it. Suppose we have a sample assembly, MyAssembly.dll, with a class MyClass. We wish to dynamically load it and invoke its methods. MyAssembly code: namespace MyAssembly { public class MyClass { public int X { get; set; … Read more