Replace existing class definition at runtime with newly created type
问题 Demorepo : https://github.com/gabbersepp/csharp-dynamic-replace-class How to use : Checkout Compile Delete TestLib.dll & TestLib.pdb from console/bin/Debug Execute console.exe through cmd Read first : I have something in mind I want to achieve at work and I think that this would be the best solution. So please do not discuss if I can solve this with another way. If I would like to discuss about this, I will create a new SO post. Given : A class in a lib: namespace Test.TestLib { public class