Roslyn Samples

I recently finished up a chapter for "Metaprogramming in .NET" on Roslyn. One of the things I found most interesting about Roslyn was not the "generate and execute code on the fly" aspect. That's still really cool, and Roslyn makes it really easy to do that dynamic code execution relative to APIs like System.Reflection.Emit. But what I found pretty addictive was the Visual Studio integration portions. Being able to create code issues and refactorings with the code the user was typing was really not that hard to do. Overall, given that it's only a CTP, there's a lot to play with in Roslyn (and it's relatively stable, though it is a little slow).

If you want to take a look at the code samples I've created, you can go here. Here's a quick list of what's in "Chapter 12":

  • DynamicMocks.Roslyn - A simplistic mock generator, but the possibilities can go much farther than what I've done as an example.
  • Wcf.Issues - A code issue to fix IsOneWay issues in WCF operations.
  • Core.Refactorings - A refactoring that auto-arranges class members.

While it says on Roslyn's web site that the project "is a long lead project which we are considering for the post-Visual Studio 11 timeframe", I still think it's important to look at where Roslyn is going. My personal opinion is that Roslyn will have a large impact on the .NET world once it's released, and it's worth a .NET developer's time to be aware of what can be done with the functionality that's contains within Roslyn.

* Posted at 12.27.2011 02:17:52 PM CST | Link *

Blog History