Hi everyone,

If you compile the attached files, like this:

mcs --target library testdll.cs
mcs -r testdll.dll usedll.cs

And then disassemble usedll.exe, you'll see that ToString calls
[mscorlib]System.Object::ToString() instead of
[testdll]testdll::ToString() (as csc does). This will cause version
problems, if a new version of the dll overrides ToString, it will not be
called.

The problem is that, AFAIK, Reflection.Emit doesn't have the ability to
create a MethodInfo for an inherited method, but I hope I'm wrong.

Regards,
Jeroen
public class testdll
{
}
class test : testdll
{
public static void Main()
{
System.Console.WriteLine("hello from test: " + new test());
}

public override string ToString()
{
return "it's me: " + base.ToString();
}
}

Reply via email to