I have a running appliation which load an Assembly in runtime. I have a folder, which full of .dll files. Whenever a caller make a request, my application will look into a selected dll and load it. Here is snippet of my codes.
if (File.Exists(Path.Combine(assemblySavePath, proxy.AssemblyFileName)))
{
Assembly = Assembly.LoadFile(Path.Combine(assemblySavePath, proxy.AssemblyFileName));
// after this just use it normally
}
Basically whenever a request, I will load it. So my question is, performance wise, is this the correct way? Because I was wondering whether there's a way I could look into memory/GAC/AppDomain first, check whether it existed, without needing me to LoadFile() everytime there's a request.