[Mono-bugs] [Bug 481687] New: System.Convert.ChangeType(someIConvertibleObject, typeof(Image) Throws exception on mono. .Net difference

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Mar 3 18:54:53 EST 2009


           Summary: System.Convert.ChangeType(someIConvertibleObject,
                    typeof(Image) Throws exception on mono. .Net
    Classification: Mono
           Product: Mono: Class Libraries
           Version: SVN
          Platform: x86
        OS/Version: Ubuntu
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: tom_hindle at sil.org
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:
Gecko/2009020911 Ubuntu/8.04 (hardy) Firefox/3.0.6

This following code (See attached file for more details) attempts to convert on
object that implements IConvertible into a type of image.

The object has implicit operator's to facility this conversion. 

BitmapStatus bitmapStatus = new BitmapStatus(1);
System.Convert.ChangeType(bitmapStatus, typeof(Image));

This Works on .NET (Visual Studio 2008 targeting .NET 3.5)

mono svn: 125585

Reproducible: Always

Steps to Reproduce:
1. Run Attached test case
Actual Results:  
Unhandled Exception: System.InvalidCastException: Unknown target convertion
type from BitmapStatus to System.Drawing.Image
  at System.Convert.ToType (System.Object value, System.Type conversionType,
IFormatProvider provider) [0x00219] in
  at System.Convert.ChangeType (System.Object value, System.Type
conversionType) [0x00040] in

Expected Results:  
Should Write "Image returned succesfull" to the Console.

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list