title: Roslyn Compiler as a service
body: <p>I would like to ask you for explanation of how to use the roslyn as a service to integrate it in the application that I developed?</p>
  
  <p>Also, how could I use it as compiler that take code form user and produce the output?</p>
  
  <p>I have searched a lot but I can't understand that</p>
  
  <p>I started already with a simple solution but there are some errors:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.ComponentModel;
  using Roslyn.Scripting;
  using Roslyn.Scripting.CSharp;
  namespace RoslynTest
  {
      class Program
      {
          static void Main(string[] args)
          {
              ScriptEngine engine = new ScriptEngine();
              Session session = Session.Create();
              engine.Execute("using system;", session);
              engine.Execute("for(int i=0;i&lt;10; i++) console.writeLine(i*1); ", session);
          }
      }
  }
  </code></pre>
  
  <p>The errors are:</p>
  
  <blockquote>
    <p>Error 1   'Roslyn.Scripting.Session' does not contain a definition for 'Create'</p>
    
    <p>Error 2   'Roslyn.Scripting.CSharp.ScriptEngine' does not contain a definition for 'Execute' and no extension method 'Execute' accepting a first argument of type 'Roslyn.Scripting.CSharp.ScriptEngine' could be found (are you missing a using directive or an assembly reference?)</p>
  </blockquote>