title: C# Intercept/change/redirect a method
body: <p>Let's say I have a private, "instance," non-static, bool method in a third-party dll. All this method does is return a value. Nothing else. How would I go about intercepting calls to this method, changing it's IL OpCodes/method body, or redirecting it to an extra, overridden or derived method.</p>
  
  <p>I do not want to decompile the third-party dll, manually change the source, and recompile it.
  I also would rather not to save the assembly to disk as this would also involve using a "recompiled" assembly instead of the original.</p>
  
  <p>I basically want to be able to use the original dll - no replacements or file changes. I just want to do what I mentioned above.</p>
  
  <p>Is there any way to go about this? If so, can you elaborate or post references/tutorials/etc.</p>
  
  <p>Also, I know of virtual, override, and new modifiers, but remember that I: do not have the source of said third-party dll, cannot get access to the source, do not want to decompile with something such as dotPeek and recompile.</p>
  
  <p>Thanks!</p>
  
  <p>Edit:
  I forgot to mention the rest of the infrastructure:
  MainProgram loads ThirdPartyDLL.
  MainProgram also loads MyPluginDLL.
  I'm trying to change a method in ThirdPartyDLL from MyPluginDLL so that when MainProgram calls said method, it will call the changed method. I want to be able to do this WITHOUT saving a new assembly and restarting the MainProgram with the new assembly. Essentially, I want to do this either at startup or when MainProgram is running.</p>