Is there a way to change the methods in an existing .NET assembly and execute the assembly without saving it to disk. I would like the functionality to be similar to System.Reflection.Emit.MethodRental, but the namespace Reflection.Emitonly deals with a dynamically created assembly. There are many approaches that include creating a new executable file. or modifying an existing one, but I would like to avoid doing any of these things.
I could use the CLR profiler JR compilers to overwrite the method bodies, but would prefer an approach that could be done in C #. The use case is part of the profiler, which displays program values when the function enters / exits.
source
share