[Mono-bugs] [Bug 640182] New: System.Reflection.TargetParameterCountException: parameters do not match signature

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Sep 17 12:32:00 EDT 2010


https://bugzilla.novell.com/show_bug.cgi?id=640182

https://bugzilla.novell.com/show_bug.cgi?id=640182#c0


           Summary: System.Reflection.TargetParameterCountException:
                    parameters do not match signature
    Classification: Mono
           Product: Mono: Runtime
           Version: SVN
          Platform: 64bit
        OS/Version: RHEL 5
            Status: NEW
          Severity: Critical
          Priority: P5 - None
         Component: misc
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: srfcanada at hotmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; WOW64;
Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; MS-RTC LM 8)

the following sample code works on windows but fails on mono. Note that this
worked about a month or so ago so something recently caused this error to now
appear.

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Reflection;

  public interface IChildInterface
   {

   }

   public class ChildClass1 : IChildInterface
   {

   }

   public class TestGeneric<T>
   {

      public void Set(T v, IChildInterface r)
      {
         Console.WriteLine("Worked!!");
      }



      public void Set(T v)
      {
      }

      public void Set(T v, params long[] index)
      {
      }


      public void Set(T v, IChildInterface r, params long[] index)
      {
      }
   }

   class monofail4
   {
      static int Main(string[] args)
      {
         Type genTypeProp =
typeof(TestGeneric<>).MakeGenericType(typeof(Double));
         object propArray = Activator.CreateInstance(genTypeProp, new object[]
{ });
         Type[] arrTypes = new Type[2];
         arrTypes[0] = typeof(double);
         arrTypes[1] = typeof(ChildClass1);
         MethodInfo methPropArray = genTypeProp.GetMethod("Set", arrTypes);

         ChildClass1 a1 = new ChildClass1();
         object[] arrParameters = new object[2];
         arrParameters[0] = 15;
         arrParameters[1] = (IChildInterface)a1;
         methPropArray.Invoke(propArray, arrParameters);



         return 0;
      }
   }


Reproducible: Always

Steps to Reproduce:
1.
2.
3.

-- 
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