Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Roslyn CTP v2 Released

DZone's Guide to

Roslyn CTP v2 Released

·
Free Resource
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
Topics:

Published at DZone with permission of Filip Ekberg, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}