Roslyn CTP v2 Released
Installing Visual Studio 2012 RC SDK

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
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)









