Replacing a class with Mono.Cecil
- by icktoofay
Say I have assembly A. It was modified with Mono.Cecil a little bit. Now say I have assembly B. It has a class named SomeClass. Assembly A also has a class named SomeClass. Now I want to replace SomeClass from assembly A with the one in assembly B. I tried a few things, but I know that for one of my attempts, it actually remapped a method call like this:
Console.WriteLine("Test.");
...into this:
int.WriteLine("Test.");
That can't be right. What is the correct way to replace a class with Mono.Cecil?