title: Beginner's reflection issues
body: <p>I'm trying to learn reflection in C# and need some help with my code. I've had trouble finding good code examples/guides, so I apologize if my code is poorly done.</p>
  
  <p>Essentially I'm just trying to check out a given assembly dll for a particular method name (path and method name have been redacted).</p>
  
  <p>The problem occurs on the line <code>object lateBoundObj = asm.CreateInstance(typeName);</code> and it reads <code>An object reference is required for the non-static field, method, or property...</code></p>
  
  <p>I understand this has to do with static vs non-static and creating a <code>new Assembly</code> or something along those lines, but need some help understanding the issue and how to fix it.</p>
  
  <p>Thank you!</p>
  
  <pre><code> public const string assemblyPath = @"&lt;my file path&gt;";
      Assembly asm;
  
      static void Main(string[] args)
      {
          //asm = new Assembly();
          Console.Read();
  
          MethodInfo mi;
          object result = null;
          object[] arguments = new object[] { "ABC123" };
  
          try
          {
              Assembly assemblyInstance = Assembly.LoadFrom(assemblyPath);
              Type[] types = assemblyInstance.GetTypes();
  
              foreach (Type t in types)
              {
                  mi = t.GetMethod("&lt;my method name&gt;");
  
                  if (mi != null)
                  {
                      string typeName = t.FullName;
                      object lateBoundObj = asm.CreateInstance(typeName);
                      result = t.InvokeMember("GetWeb", BindingFlags.Public | BindingFlags.InvokeMethod | BindingFlags.Instance, null, lateBoundObj, arguments);
                      break;
                  }
              }
              //set return for find method
          }
          catch (Exception ex) { }
      }
  </code></pre>