BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Introducing the Roslyn Project System

Introducing the Roslyn Project System

After 15 years, Microsoft is replacing the COM-based C# and Visual Basic project systems inside Visual Studio. Microsoft gives several reasons for wanting to abandon the current system:

  • Native and COM-based
  • Single threaded and bound to the UI thread
  • Hard to extend outside of aggregation via the use of <ProjectTypeGuids> and sub types (flavors)
  • Tied to Visual Studio

The goals for the new C# and Visual Basic project system include,

  • Managed and managed-interface based
  • Multi-threaded, scalable, and responsive
  • Easy to extend via the use of the Managed Extensibility Framework (MEF) and composable. Many parties, including 3rd parties, can contribute to a single project system
  • Hostable outside of Visual Studio

To this effect, the new code base is being written in a mixture of VB and C#.

What is a “Project System”?

According to the Roslyn Project System homepage,

A project system sits between a project file on disk (for example, .csproj and .vbproj) and various Visual Studio features including, but not limited to, Solution Explorer, designers, the debugger, language services, build and deployment. Almost all interaction that occurs with files contained in a project file, happens through the project system.

It needs to be noted that this isn’t a build system. While it may need to communicate with the build system (i.e. MSBuild), its role it to sit between the IDE and the project files. (And if all goes well, sit between third-party tools and the project files as well.)

Why Visual Basic?

The reason Visual Basic is being used for so much of the new project system is simply because it already exists. While the core is being rewritten from C++ to C#, “the Application Designer, Property Pages, Resources Editor, and Settings Designer were all written in VB circa 2003/2004 by the VB team for Visual Studio 2005” (source). So it simply made more sense to just port that code than rewrite it from scratch.

What about the Common Project System?

The Common Project System still exists and the Roslyn Project System will sit on top of it.

If you are unfamiliar with the term, the Common Project System was announced last summer along with the Project System Extensibility Preview. Its goal is to make it easier for developers to create new project types in Visual Studio. From the press release,

We are very pleased and excited to announce the availability of the Project System Extensibility Preview. With it, you can define a new project type and begin writing extensions to customize the user experience or add features in just a few minutes while owning very little code. Gone are the days where you have to create or maintain an entire project system (usually a fork based on MPFproj) often containing well over 100K lines of code. Instead, you’ll be building on the Common Project System (CPS) that ships with Visual Studio and is already used by C++, JavaScript, and ASP.NET 5. Here is a short video to help get you started.

It goes on to talk about how whenever the main MPFproj branch is updated, every project type needed to merge the changes into their own project type-specific branch. As you can imagine, this wasn’t a tenable long-term solution for anyone without a huge maintenance budget. Which in turn explains why we don’t see the wide variety of project types that you find in other IDEs.

Rate this Article

Adoption
Style

BT