.NET Zone is brought to you in partnership with:

I am a Software Engineer working with the latest in .NET focusing on Web Development. With a burning heart for programming, I blog and author a book about C#. Filip is a DZone MVB and is not an employee of DZone and has posted 36 posts at DZone. You can read more from them at their website. View Full User Profile

Roslyn CTP v2 Released

06.13.2012
| 1876 views |
  • submit to reddit
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
Published at DZone with permission of Filip Ekberg, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)