I have a C# ClassLibrary that contains a function to sum two numbers:
namespace ClassLibrary1
{
public class Calculator
{
public int Calc(int i, int b) {
return i + b;
}
}
}
I want to load this dll from other C# application externally. How can I do this?
Do you mean you want to load it dynamically, by file name? Then yes, you can use the
Assembly.LoadFilemethod as follows:(Translated example from here, but I wrote it so don’t worry!)