I’m playing around with Roslyn and trying to make a simple example where i:
- Load a .csproj
- Make some minor change to the code (currently I just replace some stuff)
- Compile the changed project to memory or a new dll.
So far 1 and 2 is done but I’m having some problems with the compile part. If I compile it to a new dll and inspect it (with dotPeek) it doesn’t have my new changes. It’s simply the orginal code.
My current code look like this: https://pastebin.com/eFEYbLqA
Anyone with Roslyn experience that can point me in the right direction? Maybe I just missunderstand the “emit” method, because it say “Emit the IL for the compiled source..”. So maybe I need to compile it some other way first?