DLL ランタイムをロードし、DLL に存在するクラスの 1 つでメソッドを呼び出そうとしています。
DLL をロードしてメソッドを呼び出す場所はここにあります。
Object[] mthdInps = new Object[2];
mthdInps[0] = mScope;
string paramSrvrName = srvrName;
mthdInps[1] = paramSrvrName;
Assembly runTimeDLL = Assembly.LoadFrom("ClassLibrary.dll");
Type runTimeDLLType = runTimeDLL.GetType("ClassLibrary.Class1");
Object compObject = Activator.CreateInstance(runTimeDLLType, mthdInps);
Type compClass = compObject.GetType();
MethodInfo mthdInfo = compClass.GetMethod("Method1");
string mthdResult = (string)mthdInfo.Invoke(compObject, null);
これがクラス(DLLに存在)と私が呼び出そうとしているそのメソッドです。
namespace ClassLibrary
{
public class Class1
{
public Class1() {}
public String Method1(Object[] inpObjs)
{
}
}
}
私が得ているエラーはこれです、
Constructor on type 'ClassLibrary.Class1' not found.
助けてください。