Microsoft to let devs see .NET source

Microsoft is making the source code available for the .NET Framework libraries in order to help developers debug their .NET projects. While the software giant stopped short of open source, just being able to look at the code and step into it in the debugger will be a welcome addition for .NET developers.
Written by Ed Burnette, Contributor

Any long time MFC coder will tell you that one of the things Microsoft did right was to include the source code to MFC libraries with the binaries. That way, when you were debugging your own program, you could step into any library functions you called to see why they weren't working like you expected, or look backwards in the stack trace to see who called your code and why. At long last Microsoft is doing the same thing with the .NET framework libraries.

So is MS open sourcing .NET? No. The code will be available under the Ms-RL license which grants you a license to use the software for "reference use" only. It's not shared source, and it's not open source, and it's certainly not free software. From the license:

"Reference use" means use of the software within your company as a reference, in read only form, for the sole purposes of debugging your products, maintaining your products, or enhancing the interoperability of your products with the software, and specifically excludes the right to distribute the software outside of your company.

Microsoft will start by offering the source code for the following libraries:

  • the .NET Base Class Libraries (System, System.IO, System.Collections, System.Configuration, System.Threading, System.Net, System.Security, System.Runtime, System.Text, etc),
  • ASP.NET (System.Web),
  • Windows Forms (System.Windows.Forms),
  • ADO.NET (System.Data),
  • XML (System.Xml), and
  • WPF (System.Windows).

MS will be adding more libraries in the months ahead (including WCF, Workflow, and LINQ).

The way it will work is pretty neat: when you debug a .NET application in Visual Studio 2008 the debugger will automatically download symbols and source code for the particular version of .NET (including service packs, etc.) that you are running. When you step into a call to DataBind() method on a Grid View control, for example, VS2008 will contact MS's servers to get the right source code for you.

This is not just line numbers, folks. According to Microsoft, the Locals and Watch windows are fully supported both in your code and the .NET Framework source. MS is providing full debug info, including local variables and class member info.

Based on prior experience with Microsoft's symbol servers, I expect the process to be quick and painless. The information will be cached on your local hard disk so you only have to download it once. And people who don't use VS2008 will be able to get the source in a (large) standalone install.

So, sorry Mono/Moonlight project, .NET is still proprietary and you still have to re-implement everything yourself. Good luck with that. But for developers on Windows who have bought into the Microsoft walled garden (and there are plenty of folks who are happy with that, despite the comments this post will probably generate), just the ability to look at the source will be a godsend.

See Scott Guthrie's blog for more details and screenshots.

Editorial standards