[Mono-devel-list] Default:ChangeType, MonoType, dynamically loaded assemblies and MonoCMethod:Invoke on constructors

Gary M. Smithrud gary.smithrud at haley.com
Thu Jun 23 11:07:15 EDT 2005


I'm back in town and have had a chance to look into this issue and it
looks like the problem is not related to the assemblies and loading them
(which is good news).  Is there information about how complete the
SortedList class is?  I notice a comment in the documentation of 1.1.7
that implied that it was not fully implemented, but that was about it.
I am using 1.1.8.1.  I would really love to get my hands on MonoDevelop
for this version (I've tried to build it but no luck).  Thanks for the
information.

Gary M. Smithrud
Haley Systems, Inc.
Phone: 724-934-7853
gary.smithrud at haley.com
www.haley.com
Moving at the Speed of Change

-----Original Message-----
From: mono-devel-list-bounces at lists.ximian.com
[mailto:mono-devel-list-bounces at lists.ximian.com] On Behalf Of Gary M.
Smithrud
Sent: Thursday, June 16, 2005 7:55 PM
To: mono-devel-list
Subject: [Mono-devel-list] Default:ChangeType, MonoType,dynamically
loaded assemblies and MonoCMethod:Invoke on constructors

I have the following two assemblies that are being loaded dynamically
from within an application.  In the constructor for a class in the first
assembly, it has a parameter that is an instance of a class in the
second assembly.  When attempting to call the constructor for the first
class (using reflection), I get the exception "System.ArgumentException:
parameters" (by the way, this exception could really provide more
information or the outer one should so that way it is a little easier to
track the problem down).

Looking at the trace, it looks like the compile MonoType is different
than the MonoType for the same class when loading the assembly
dynamically (determined this by the tracing/debugging output).  The
application does not have access to the assemblies when it is built, nor
does it know the order in which they are loaded.  The first assembly
does reference the second one when it is built, of course.  In the
trace, the object that is passed in the array has the correct type, but
the type's are different when they are compared in Default:ChangeType (I
do not know what type Mono believes it is, because I have not been able
to get Mono-Develop to build.  I am not sure that I can get that
information from gdb either.)

The question is, "Has this been tested and the problem is in my code or
does Mono have an issue with this?"  Unfortunately, I am leaving town
tomorrow and do not have time right now to provide an example.  Below is
code that sort of shows the issue:

using B;
namespace A {
   public abstract class ClassA {
      ClassC _foo;	// In B.
      double _value;
      int number;
      public ClassA(ClassC foo, double value, int number) {
         _foo = _foo;
         _value = value;
         _number = number;
      }
   }
   public ClassB : ClassA {
      public ClassB(ClassC foo, double value, int number) :
base(foo,value,number) {
         // do whatever
      }
   }
}

namespace B {
   public ClassC {
   }
}

The exception occurs when you pass an instance of B.ClassC to the
constructor of ClassB.

Thanks for any information (again, I will be out of town until Tuesday,
if you have any questions),
Gary.

_______________________________________________
Mono-devel-list mailing list
Mono-devel-list at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list



More information about the Mono-devel-list mailing list