Non riesco a capire come fare questo lavoro:Come si crea un array C# usando Reflection e solo le informazioni sul tipo?
object x = new Int32[7];
Type t = x.GetType();
// now forget about x, and just use t from here.
// attempt1
object y1 = Activator.CreateInstance(t); // fails with exception
// attempt2
object y2 = Array.CreateInstance(t, 7); // creates an array of type Int32[][] ! wrong
Qual è la salsa segreta? Posso far funzionare il secondo se riesco a ottenere il tipo di elementi dell'array, ma non l'ho nemmeno immaginato.
Mi hai avuto a "salsa segreta". =) –