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

Daniel Soto daniel.soto2k at gmail.com
Mon Oct 1 22:08:53 EDT 2007


Andrés G. Aragoneses [ knocte ] escribió:
> 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 ]
>
>   
Yup! The code runs in MS.NET. In Windows Server 2003 runs fine.

It is a bug?

Best regards.


More information about the Mono-list mailing list