-1
Parameter countの不一致例外が発生しました。WindowsForms C#でSystem.Reflection.TargetParameterCountExceptionを解決する方法?
未処理の例外:System.Reflection.TargetParameterCountException:パラメーターの数が一致しません。
METHODINFOベースを呼び出すための私のコードの一部は、私は以下の方法
public string printCustomerDetails(object parameters)
{
string CustomerName = "";
foreach (object customer in parameters)
{
CustomerName = CustomerName + " " + customer;
}
return CustomerName.Trim();
}
を起動しようとしたとして
Type customerType = executingAssembly.GetType("LateBinding.Customer");
object customerInstance = Activator.CreateInstance(customerType);
MethodInfo method = customerType.GetMethod("printCustomerDetails");
string customerObject = (string)method.Invoke(customerInstance, new object[0]);
を下回っている私はMETHODINFOベースを呼び出すために逃したものはありますか?
を必要としています。 –
オブジェクト宣言を表示してください。 –
@TAHASULTANTEMURIコードを追加しました。 – Arulpriya