title: Passing a Parameter Array by ref to C# DLL via Reflection
body: <p>All, I have a number of C# DLLs that I want to call from my application at runtime using <code>System.Reflection</code>. The core code I use is something like</p>
  
  <pre><code>DLL = Assembly.LoadFrom(Path.GetFullPath(strDllName));
  classType = DLL.GetType(String.Format("{0}.{0}", strNameSpace, strClassName));
  if (classType != null)
  {
      classInstance = Activator.CreateInstance(classType);
      MethodInfo methodInfo = classType.GetMethod(strMethodName);
      if (methodInfo != null)
      {
          object result = null;
          result = methodInfo.Invoke(classInstance, parameters);
          return Convert.ToBoolean(result);
      }
  }
  </code></pre>
  
  <p>I would like to know how I can pass in the array of parameters to the DLL as <code>ref</code> so that I can extract information from what happened inside the DLL. A clear portrayal of what I want (but of course will not compile) would be</p>
  
  <pre><code>result = methodInfo.Invoke(classInstance, ref parameters);
  </code></pre>
  
  <p>How can I achieve this?</p>