Roslyn CTP v2 Released

Posted by Filip Ekberg on 05 Jun 2012

You can now download and install a new version of the Roslyn CTP. The Roslyn CTP is now compatible with Visual Studio 2012 RC for this you will need to download and install Microsoft Visual Studio 2012 RC SDK!

Installing Visual Studio 2012 RC SDK

Installing Roslyn CTP v2

Testing Roslyn in Visual Studio 2012 RC When the installation has finished, you can start Visual Studio 2012 and create a Roslyn Console Application:

Then we can create a simple ScriptEngine that just executes a snippet:

var engine = new ScriptEngine();
var result = engine.Execute<bool>("var x = 10; x == 0");

Console.WriteLine(result);

I tried upgrading the code from the my previous post on "Hosted code execution" and it seems to only be minor changes that are needed. These were the only errors:

  • The constructor for `CompilationOptions` takes less parameters ( no longer a lot of optional parameters )
  • `ParseOptions` no longer has a constructor defined, use `CompilationOptions.Default`
  • `ObjectFormatter` no longer has a constructor defined, use `ObjectFormatter.Instance`

There are most likely a lot of other changes made, but these are the ones that broke the build of "Hosted code execution".

See a list of API Changes here. The post also lists the new language features implemented since CTP1 (C#):

  • Anonymous Types
  • Attributes (full support)
  • Base call support
  • Checked and unchecked expressions and blocks
  • Events
  • Finalizers
  • Generic constraints
  • Implicitly-typed arrays
  • Indexers
  • Iterators
  • Lock statements
  • Named and optional parameters
  • Param array parameters
  • Partial methods
  • Operator overloading
  • Query expressions
  • Switch statements
  • User-defined conversions
  • Using statements
  • Volative fields

comments powered by Disqus