title: Load an assembly from an embedded resource
body: <p>I would like to load a dll file (Test.dll) as an assembly. I am able to do this using both direct Visual Studio references (ie. loading the dll as a reference to my C# application) as well as loading the dll using the <code>Assembly.LoadFile(filename)</code> method. Now, I would like to add my dll file as an <em>embedded resource</em> to my Visual Studio application, and load the dll file as an assembly. I know how to load this resource as a byte array, is there some correlation between the byte array and the assembly that I could use? Furthermore, I need to be able to call a method located within the dll file. See the code below - it will further explain what I am doing.</p>
  
  <pre><code>Assembly SampleAssembly = Assembly.LoadFrom("WindowsFormsApplication2.ThisisaTESTDLL.dll");
  Type myType = SampleAssembly.GetTypes()[0];
  MethodInfo Method = myType.GetMethod("myVoid");
  object myInstance = Activator.CreateInstance(myType,null);
  Method.Invoke(myInstance,new object[] { "param1", "param1"});
  </code></pre>
  
  <p>If I am missing anything here, please respectfully let me know and I will edit the original post. </p>