[Mono-bugs] [Bug 537248] New: MissingMethodException when trying to instantiate class using the generic T()

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Sep 7 15:37:17 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=537248


           Summary: MissingMethodException when trying to instantiate
                    class using the generic T()
    Classification: Mono
           Product: MonoTouch
           Version: unspecified
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Blocker
          Priority: P5 - None
         Component: Runtime
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: fak at kruegersystems.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Created an attachment (id=317099)
 --> (http://bugzilla.novell.com/attachment.cgi?id=317099)
Project file

Description of Problem:

An exception is thrown when instantiating a class using the generic "new T()".

Steps to reproduce the problem:
1. Load the attached project
2. Run it

Note the function "WorkAroundBugs" in Main.cs. You can uncomment those lines to
see this execute correctly.


Actual Results:

Unhandled Exception: System.MissingMethodException: Method not found: 'Default
constructor not found...ctor() of Db.User'.
  at System.Activator.CreateInstance (System.Type type, Boolean nonPublic)
[0x00000] 
  at System.Activator.CreateInstance (System.Type type) [0x00000] 
  at System.Activator.CreateInstance[User] () [0x00000] 
  at SQLiteClient.SQLiteCommand+<ExecuteQuery>c__Iterator0`1[Db.User].MoveNext
() [0x00000] 
  at Db.AppDelegate.FinishedLaunching (MonoTouch.UIKit.UIApplication app,
MonoTouch.Foundation.NSDictionary options) [0x00000] 
  at (wrapper managed-to-native)
MonoTouch.UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
  at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String
principalClassName, System.String delegateClassName) [0x00000] 
  at MonoTouch.UIKit.UIApplication.Main (System.String[] args) [0x00000] 
  at Db.Application.Main (System.String[] args) [0x00000] 


Expected Results:

The object gets created and no exception is thrown. (There is an additional bug
posted regarding missing Setters, if this is patched then things work.)

How often does this happen? 

Always


Additional Information:

-- 
Configure bugmail: http://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