Hello everybody,

I found a strange behavior with mono when I ran the following code snippet for side-by-side execution.

<first.dll version 1.0.1>
using System;
namespace first
{
    class ClassFirst
    {
        public void Print()
        {
            Console.WriteLine("This is version 1");
        }
    }
}

<first.dll version 1.0.2>
using System;
namespace first
{
    class ClassFirst
    {
        public void Print()
        {
            Console.WriteLine("This is version 2");
        }
    }
}

<MainApplication.exe>
using System;
using System.Reflection;
using first;

namespace MainApplication
{
class Class1
{
static void Main()
{
// creating instance from the version 1.0.1 assembly
ClassFirst cf = new ClassFirst();
cf.Print();


// loading the version 1.0.2 dll
Assembly ass = Assembly.LoadFrom("C:\\NewVersion\\first.dll");
type [] t = ass.GetTypes();
object o = System.Activator.CreateInstance(t[0]);
MethodInfo method = t[0].GetMethod("Print");
method.Invoke(o, null);


        }
    }
}

Output on MS-CLR:
This is version 1
This is version 2

Output on mono-0.25
This is version 1
This is version 1


<..>


I can't figure out any reason as to why this thing is not working on mono.
Is it a bug or am I missing something ??


-pG-
___________________________________________________
Television meets Accounts; Jyoti Weds Rajaram.
Rediff Matchmaker strikes another interesting match !!
Visit http://matchmaker.rediff.com?1

_______________________________________________
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to