0

When I am inspecting code, I often find my self reading and modifying decompiled files. Rider or Resharper decompile files automatically.

Later on, I add a bunch of Console.WriteLine(), to better understand what the program is doing. The problem is, changes made to decompiled code are not shown in subsequent runs/ builds of the program. Therefore I cannot inspect the code, because the original never changed.

What should I do, so that the decompiled files are used instead of the original ones in the newly executed runs? Is there some checkbox that needs to be checked?

sanjihan
  • 5,592
  • 11
  • 54
  • 119
  • 2
    Why would you edit the temporary decompiled file instead of editing the actual source? Those files are exactly that **temporary**, if they we're meant to be reused in subsequent runs they wouldn't be temporary – MindSwipe Oct 25 '19 at 09:43
  • For learning purposes. Imagine an already compiled project that is part of the larger project you want to learn from. Making changes and seeing what they do gives you insight. – sanjihan Oct 25 '19 at 09:45
  • Why don't you operate on the original projects sources? – Alexander Powolozki Oct 25 '19 at 09:54
  • The class that I would like to modify is part of a .dll file. If I find the dll file and then open the class I am interested in, it still opens as a decompiled file. – sanjihan Oct 25 '19 at 10:08
  • 1
    If you want changes to decompiled code to be effective then you'll have to create a project for it. So you'll build a new DLL, which you can now reference in a program. Also be safe and change the [AssemblyVersion] so you won't get one from the GAC. Do favor using the debugger instead of Console.WriteLine() calls so none of this is necessary. – Hans Passant Oct 25 '19 at 10:10

0 Answers0