Is it possible to write a C# assembly which when loaded will inject a method into a class from another assembly? If yes, will the injected method be available from languages using DLR, like IronPython?
namespace IronPython.Runtime
{
public class Bytes : IList<byte>, ICodeFormattable, IExpressionSerializable
{
internal byte[] _bytes;
//I WANT TO INJECT THIS METHOD
public byte[] getbytes()
{
return _bytes;
}
}
}
I need that method, and I would like to avoid recompiling IronPython if possible.