I want to load the assembly via the following
var loadedAssembly = Assembly.Load(File.ContentsAsBytes);
the File.ContentAsBytes returns the dll as a byte[]
, via the following
System.IO.File.ReadAllBytes("dll location");
The issue is the loaded assembly (loadedAssembly
) loses its phyisical location
- loadedAssembly.CodeBase - is set to the assembly which is loading it (which is not correct)
- loadedAssembly.Location - is empty
Is there a way to load from a byte[]
and getting a similar result to Assembly.LoadFile
as I need the the result to work with the AppDomain.CurrentDomain.AssemblyResolve