title: Formatting generated C# code
body: <h2>Duplicate</h2>
  
  <blockquote>
    <p><a href="https://stackoverflow.com/questions/681500/c-to-format-indent-align-c-properly">C# to format (indent, align) C# properly</a>  </p>
  </blockquote>
  
  <hr>
  
  <p>I am generating a bunch of code and would like it's initial output (pre ctrl+K, Ctrl+D)  to look reasonable. Managing indents is a royal pain and there has to be a utility or class out there I can embed inside of my code generator. I am embedding this into a VS add-in and in a build process so I am not interested in an external program. I need something I can call programatically.</p>
  
  <p>Recommendations?</p>