[Mono-list] bug casting to a List<T>

"Andrés G. Aragoneses [ knocte ] "Andrés G. Aragoneses [ knocte ]
Sat Sep 29 16:42:24 EDT 2007


Daniel Soto escribió:
> Hi All.
> 
> When i try to cast to a Generic.List<T> from object type, i get the 
> exception
> 
> System.InvalidCastException: Cannot cast from source type to destination type.
> 
> The code that throws the exception, here
> 
> System.Collections.Generic.List<MyClass> myList;
> myList = (System.Collections.Generic.List<MyClass>)Session["ListInMemory"];
> 
> The same occurs if i try to cast to ArrayList, or an Array of object.
> 
> 
> This is a bug? In the bug list in the main page of mono, it says that it's resolved, 
> but to me still doest not work :-(
> 
> Either i can to report this bug, my novell account says that my access 
> is forbidden (huh? but i finish creating it!!).
> 
> There are another way to passing the values from object to my List?
> 
> Best regards.
> 

Have you tested that code with MS.NET? (If it doesn't work there too, 
it's likely not a bug.)

Regards,

	Andrés	[ knocte ]

-- 



More information about the Mono-list mailing list