Programmatic MSIL injection
Let's say I have a buggy application like this: using System; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { Console.WriteLine("2 + 1 = {0}", Add(2, 1)); } static int Add(int x, int y) { return x + x; // <-- oops! } } } The application is already compiled and deployed into the wild. Someone has found the bug, and now they are requesting a fix for it. While I could re-deploy this application with the fix, its an extreme hassle for reasons outside of my control -- I just want to write a patch for the bug instead. Specifically, I want to insert my own MSIL into