Announcing Microsoft “Roslyn” June 2012 CTP

I’m happy to announce a new Microsoft “Roslyn” CTP release, which is available for immediate download here! Roslyn is our long-lead project to rebuild the entire C# and Visual Basic language compilers and Visual Studio language services from the ground up. Long lead projects like these allow us to make larger architectural changes in the product, and enable exciting innovation, while maintaining quality in the product along the way. You can learn more about the Roslyn project on the Visual Studio Developer Center or Soma’s blog. Roslyn is a significant endeavor with three key goals:

  1. Build a cleaner architecture across the compilers and IDE experiences. By exposing a set of public APIs from the compilers that the language services build upon, we’ll no longer need to duplicate code across the compilers and IDEs. Moving forward, this will give us much more agility when introducing new language features.
  2. Enable anyone to build tools or applications that deeply understand source code in the same way that the compilers and IDEs do. In the past, if you wanted to build a tool that works with C# or Visual Basic source code, you were pretty much on your own. Even creating something as simple as a tool to generate HTML for syntax highlighted code was hard. With Roslyn, building such a tool is significantly easier. In addition, Roslyn opens up new scenarios by providing APIs to enable application scripting, something that traditionally has been much more difficult.
  3. Create richer C# and Visual Basic IDE experiences in Visual Studio. Roslyn introduces a stream-lined refactoring experience and several new IDE productivity enhancements that focus on making it easy to make modifications to your code. You can even create your own refactorings! Also, Roslyn introduces a brand new Interactive Window (i.e. REPL, or read-eval-print-loop) that allows users to type code and see it immediately evaluated. This is a powerful way to explore a new API, try out an idea, or even build up pieces of an application.

Ultimately, by providing developers with the infrastructure to build richer “code smart” tools, Roslyn allows us to take the C# and Visual Basic language experiences beyond the current state-of-the-art.

In addition to providing support for Visual Studio 2012 RC, the June CTP includes several new language features and API updates.

Support for Visual Studio 2012 RC

Replacing a compiler that is responsible for running a big chunk of the Internet and rich client applications is not something one does lightly. Our general approach for re-architecting the compilers is to complete them before entering a product cycle. That way, we can use them and ensure they have high quality throughout the cycle. Because of this, Roslyn is not shipping as part of Visual Studio 2012 and will ship in a future VS release instead. However, we want to enable anyone who has VS 2012 installed to explore the Roslyn APIs and use the C# Interactive Window. To allow this, the CTP refresh will install on both Visual Studio 2012 RC and Visual Studio 2010 SP1 (note that VS 11 Beta is not supported).

New Language Features

We haven’t been sitting still and the list of language features supported by C# and Visual Basic is only growing in Visual Studio 2012. However, the Roslyn team is catching up quickly and has been implementing the C# and Visual Basic languages at an extremely fast pace. As each language feature is implemented, we continue to prove the Roslyn architecture by ensuring that it not only compiles, but has great API and IDE tooling support, and works in C# Interactive Window (pictured below).


Since the last CTP, several language features have been implemented, such as query expressions, anonymous types, iterators, and many more!

Updated APIs

Since releasing the first Microsoft “Roslyn” CTP in October, we’ve received tons of great input and have made several positive changes in response to that feedback. A few highlights are listed below:

· New Code Formatting API to automatically format C# or Visual basic source code using the appropriate language formatting rules.

· New Find All References API to find references to symbols within a solution (pictured below).

· New Source Code Generation API to easily generate source code for C# and Visual Basic types and members.

· Numerous API clarifications, renames, and general improvements based on feedback received from the October 2011 CTP.

The following example shows using the new Find All References API to locate all of the references to System.String.


Please note that due to the number of changes, most projects created with the October 2011 CTP will need to be updated to the latest APIs in order to work with them in the new June 2012 CTP.


For more information on the Roslyn project and to download the new CTP, you can visit the Roslyn home page on the Visual Studio developer center. We also invite you to discuss with the team on the Roslyn forum.



Follow me at .