我傳遞類型名和從C#代碼一些參數到VB寫一個導航框架的構造函數。導航框架在類型上查找與使用Type.GetConstructor(Types())傳遞的參數相匹配的構造函數。我正在尋找的構造函數需要一個整數數組 - 在vb中的Integer()。但它得到一個System.Int32數組。只要試試這個我已經走了:C#/ vb.net類型不匹配查找由反射(整數()對System.Int32 [])
System.Int32[] int32Array = IdList.ToArray();
int[] intArray = new int[int32Array.Length];
for (int i = 0; i < int32Array.Length; i++)
{
intArray[i] = (int)int32Array[i];
}
而且VB代碼仍然可以看到System.Int32在另一端,這意味着它沒有找到構造函數。
任何見解?