title: Inline method as a build step
body: <p>I have a method that checks the license in our application. I would like to inline this method during build (or after) to increase the complexity of hacking the license. Basically I want something to take the code in this method, walk through all the usages, and substitute them to the copies of the code - then remove all the usages and the method itself. This is very similar to what Resharper does on <code>Ctrl+Alt+N Inline method</code>:<a href="https://i.stack.imgur.com/IwRBy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IwRBy.png" alt="enter image description here"></a></p>
  
  <p>But rather as a build step. Is it possible somehow?</p>
  
  <p>I've looked at <code>[MethodImpl(MethodImplOptions.AggressiveInlining)]</code> attribute, but this is not what I want. It affects only the compiled code after JIT, but I would like to do this for generated IL.</p>
  
  <p>I will also use obfuscator after this.</p>