You can load the assembly as bytes and load it with Assembly.Load(bytes)
, maybe this works.
Or you give the application the requested permission.
Edit:
I did a little test and it worked for me. Here is the code:
static Dictionary<Assembly, String> _Paths = new Dictionary<Assembly, String>(); static void Main(string[] args) { AppDomain current = AppDomain.CurrentDomain; current.AssemblyResolve += new ResolveEventHandler(HandleAssemblyResolve);
Something important:
There may be files that do not have a matching name and file name, but you can solve this problem by checking all the files in the folder using AssemblyName.GetAssemblyName(file)
.
source share