Suppose I have the following .NET classes:
public class C
{
public void M()
{
....
}
}
and
public class
Microsoft has created a managed equivalent to Detours called Moles. The only thing I'm not sure of is the licensing; it is intended for testing (as part of Pex).
Dependency injection requires modifying the source; PostSharp requires modifying the binary; but Moles can be done dynamically at runtime.