title: Library for parsing/modifying C# source code (and compiling after that)
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/81406/parser-for-c">Parser for C#</a>  </p>
  </blockquote>
  
  
  
  <p>Any (free) libraries that can parse C# source code and make a DOM of it? </p>
  
  <p>I need to add an attribute to all classes in bunch of .cs files and then compile them to an assembly. This needs to be done in an asp.net application, so I'm not interested in Visual Studio plugins or similar.</p>
  
  <p>I need to achieve this</p>
  
  <p>input: ~/plugins/MyPlugin/MyPlugin.cs</p>
  
  <pre><code>public class MyPlugin : PluginBase, IEntitySavingPlugin
  {
  }
  </code></pre>
  
  <p>output: Plugins.dll</p>
  
  <pre><code>[PluginDirectory("~/plugins/MyPlugin/")]
  public class MyPlugin : PluginBase, IEntitySavingPlugin
  {
  }
  </code></pre>