メソッドCollection<T>
に of 型SharpSvn.SvnListEventArgs
を 渡す必要があります。svnClient.GetList
型T
は MSBuild インライン タスクで使用されるため、実行時に解決する必要があります。GetList
メソッド呼び出しは実行時エラーをスローします
' ' に最適なオーバーロードされたメソッドに
SharpSvn.SvnClient.GetList(SharpSvn.SvnTarget, out System.Collections.ObjectModel.Collection<SharpSvn.SvnListEventArgs>)
無効な引数が含まれています
以下は、私が試したコードスニペットです。どうすればこれを解決できますか?
System.Type t = svntask.GetType("SharpSvn.SvnListEventArgs");
//System.Collections.ObjectModel.Collection<System.EventArgs> branchfolderlist = new System.Collections.ObjectModel.Collection<System.EventArgs>();
System.Type genericType = typeof(System.Collections.ObjectModel.Collection<>);
System.Type constructedType = genericType.MakeGenericType(t);
var branchfolderlist = System.Activator.CreateInstance(constructedType);
//branchfolderlist = svntask.GetType("SharpSvn.SvnListEventArgs")branchfolderlist;
//System.Collections.ObjectModel.Collection<System.Object> branchfolderlist;
dynamic svnTarget = svntask.GetType("SharpSvn.SvnTarget").GetMethod("FromUri").Invoke(null, new object[] { new System.Uri(destinationBranch) });
//svntask.GetType("SharpSvn.SvnClient").GetMethod("GetList").Invoke(null, System.Reflection.BindingFlags.InvokeMethod, null, new object[] { svnTarget, branchfolderlist }, null);
svnClient.GetList(svnTarget, out branchfolderlist);
return true;
前もって感謝します !!!