mydll.dll
namespace mydll
{
public class MyClass {
public static int Add(int x, int y)
{
return x +y;
}
}
}
In another project how can I import MyClass or just Add function?
I want to add with DllImport,
[DllImport(“mydll.dll”, CharSet =
CharSet.Auto) ] public static extern
…….
how can I do that?
You can use Reflection to load assembly at runtime.
Here a piece of code you can use :
Here you can find a good tutorial.