Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Maybe MyAssembly.dll refers to some assembly that arent in the directory. Put all assemblies in the same directory.</p> <p>Or you can handle AppDomain.CurrentDomain, AssemblyResolve event to load the needed assembly</p> <pre><code>private string asmBase ; public void LoaddAssembly(string assemblyName) { asmBase = System.IO.Path.GetDirectoryName(assemblyName); AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve); System.Reflection.Assembly asm = System.Reflection.Assembly.Load(System.IO.File.ReadAllBytes(assemblyName)); } private Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) { //This handler is called only when the common language runtime tries to bind to the assembly and fails. //Retrieve the list of referenced assemblies in an array of AssemblyName. Assembly MyAssembly, objExecutingAssemblies; string strTempAssmbPath = ""; objExecutingAssemblies = args.RequestingAssembly; AssemblyName[] arrReferencedAssmbNames = objExecutingAssemblies.GetReferencedAssemblies(); //Loop through the array of referenced assembly names. foreach (AssemblyName strAssmbName in arrReferencedAssmbNames) { //Check for the assembly names that have raised the "AssemblyResolve" event. if (strAssmbName.FullName.Substring(0, strAssmbName.FullName.IndexOf(",")) == args.Name.Substring(0, args.Name.IndexOf(","))) { //Build the path of the assembly from where it has to be loaded. strTempAssmbPath = asmBase + "\\" + args.Name.Substring(0, args.Name.IndexOf(",")) + ".dll"; break; } } //Load the assembly from the specified path. MyAssembly = Assembly.LoadFrom(strTempAssmbPath); //Return the loaded assembly. return MyAssembly; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload