Let’s say I have an extern method that is used to calculate the square root of a number. Like:
using System;
public static class Program
{
Public static extern double Sqrt(double x);
public static void Main(string[] args)
{
Console.WriteLine(Sqrt(64));
}
}
For the extern method to work, I will have to load a DLL which is usually done by using DllImport.
But let’s say I want to load the DLL at runtime by calling a method, like in Java:
System.load(“Path to DLL”);
Can this be done in C#?