.NET Framework Library Source Code now available

Last October I blogged about our plan to release the source code to the .NET Framework libraries, and enable debugging support of them with Visual Studio 2008.  Today I'm happy to announce that this is now available for everyone to use. Specifically, you can now browse and debug the source code for the following .NET Framework libraries:

  • .NET Base Class Libraries (including System, System.CodeDom, System.Collections, System.ComponentModel, System.Diagnostics, System.Drawing, System.Globalization, System.IO, System.Net, System.Reflection, System.Runtime, System.Security, System.Text, System.Threading, etc).
  • ASP.NET (System.Web, System.Web.Extensions)
  • Windows Forms (System.Windows.Forms)
  • Windows Presentation Foundation (System.Windows)
  • ADO.NET and XML (System.Data and System.Xml)

We are in the process of adding additional framework libraries (including LINQ, WCF and Workflow) to the above list. I'll blog details on them as they become available in the weeks and months ahead.

Enabling Reference Source Access in Visual Studio 2008

Enabling .NET Framework source access within Visual Studio 2008 only takes a few minutes to setup. Shawn Burke has a detailed blog post that covers the exact steps on how to enable this in more depth here.

If you run into problems or have questions setting it up, please post a question in the Reference Source Forum on MSDN here.

Stepping into .NET Framework Library Source

Once you follow the configuration steps in Shawn’s post above, you’ll be able to dynamically load the debug symbols for .NET Framework libraries and step into the source code. VS 2008 will download both the symbols and source files on demand from the MSDN reference servers as you debug throughout the framework code:

Developer comments are included in the source files. Above you can see an example of one in the Dispose method for the Control base class.

Sometimes you'll see comments that reference a past bug/tracking number in our bug/work-item tracking database that provides additional history about a particular code decision. For example, the comment above calls out that a particular field shouldn't be nulled to maintain backwards compatibility with an older release of the framework, and points to a backwards compatibility bug that was fixed because of this.

Reference License

The .NET Framework source is being released under a read-only reference license. When we announced that we were releasing the source back in October, some people had concerns about the potential impact of their viewing the source. To help clarify and address these concerns, we made a small change to the license to specifically call out that the license does not apply to users developing software for a non-Windows platform that has “the same or substantially the same features or functionality” as the .NET Framework. If the software you are developing is for Windows platforms, you can look at the code, even if that software has "the same or substantially the same features or functionality" as the .NET Framework.

Summary

We think that enabling source code access and debugger integration of the .NET Framework libraries is going to be really valuable for .NET developers. Being able to step through and review the source should provide much better insight into how the .NET Framework libraries are implemented, and in turn enable you to build better applications and make even better use of them.

Hope this helps,

Scott

89 Comments

  • Hi Scott. Glad to hear that this has finally been released. There was also a QFE release the other day to increase performance while stepping through the code. However I was unable to get the hotfix to install, and in talking with Shawn Burke, it appears that several people who had beta2 previously installed could not install the hotfix either. Do you have any information on this?

  • This is great! .NET and specificaly ASP.NET is probably the most compelling story comming out of the company these days. It really is about "Developers, Developers, Developers" and I am glad to see the strong commitment from you and your team.

  • Is the source available for the Compact Framework?

    I've worked on commercial applications for most types of .NET applications, Services, Web, Winforms, Mobile. I think I've had far more need for the source code to the compact framework than I have for the desktop platform framework source.

  • This is awesome, Scott. I was wondering if Silverlight source code could be opened as as well?

  • 可惜只是部分开源,如果全部开源就更好了

  • Hi SilverlightExamples,

    >>>>>>> This is awesome, Scott. I was wondering if Silverlight source code could be opened as as well?

    Yes - we'll be releasing the source and enabling debugging for the Silverlight libraries as well once they ship.

    Thanks,

    Scott

  • This is awesome!

    I'm particularly anxious to have the Silverlight libraries available!

  • I worry about people relying on implementation details in their apps. The problem was bad enough with reverse engineering functionality of Win32 as Raymond Chen continually demonstrates.

  • Hi Scott,

    Congtrats

  • Thanks for your post.

  • Hi scott the image provided in the post above is not loading. seems the problem of the path.

    Any way great news to hear that the source code are out and can be played (debug) with

  • This is wonderful!!! I'm fascinated. I've just taken a look at some ASP.NET source code classes! This will enable developers come up with better and even more innovative ways to create software for .NET and for Windows. hurrah!!!

  • Hi Scott;
    Hope your trip is going well. An OT question:
    As you know, Astoria team has released an update that support SL 1.1 API, however, they said they will update that API for SL2.0 when released. Looking at docs, there seem to be very minute amount of info how SL apps are supposed to work with Astoria. Seems like Astoria is more of a "General Purpose" gateway to database, rather having tight integration with SL.
    Question: What are your plans for database integration with SL? This is something that I haven't seen any info on. Could you please tell us if you're planning to cover this subject in details?

    Thanks!

  • 终于开源了,部分开源~ 有限制的开源 呵

  • .Net Framework open source

  • congratulations~~~

  • Absolutely fantasic.! Thank you guys so much!

  • Thanks for the release of much awaited

  • Great to hear that!Glad you came to Shanghai...

  • We are in the process of adding additional framework libraries (including LINQ, WCF and Workflow) to the above list. I'll blog details on them as they become available in the weeks and months ahead.

    that's a good one, lik you don't have the source code ready for the others, it's always like that with microsoft, release half of what was promised.

  • Finally, its about time! I am very excited to try this when I get back to work.

  • That is fantastic. Now we can see what happens behind the screen.

  • cool! open source .net

  • You wrote:

    'the license does not apply to users developing software for a non-Windows platform that has “the same or substantially the same features or functionality” as the .NET Framework. If the software you are developing is for Windows platforms, you can look at the code, even if that software has "the same or substantially the same features or functionality" as the .NET Framework.'

    So what does that mean for software "the same...." as the .NET Framework that works on *both* Windows and non-Windows platforms (read: Mono). I'll assume that "both" is the same as just non-Windows, but it strikes me that this clarification still leaves some room for confusion. The last thing we need (the Mono project [0]) are developers contributing to Mono after having seen any part of the .NET sources, as it would likely result in copyright infringement.

    Would it be possible to post a link to the license so that we can see the final wording?

    [0] I do not speak officially or unofficially for Mono.

    Thanks,
    - Jon

  • Very cool ... I remember how enlightening it was to dig through Sun's Swing source code ten years ago preparing for the big Java 1.1 (!) release. I am really looking forward to browsing the WPF sources and Silverlight's as soon as those are released. Thanks for the announcement, Scott!

  • Hi :) Great Move ... i long back in the past we were facing the problem of could able to bebug in several situations. which made us to move to some other alternatives. And Now it is available ..
    We can expect a great improvement.. :)

    Cheers

  • Hi, I need some features of the .NET Framework 3.5 such aus System.IO.Pipes. Does the license allow to extract them from the 3.5 sourcecode and use together with Framework 2.0? I have a shrinkwrap product and at this time, it is not possible for me to upgrade to a higher version of .NET.

  • Thats really good news, looking forward to playing around with it.

    Could I please have you poke the SharePoint guys a bit? :) Would be really nice to have the Microsoft.SharePoint namespaces as well :o)

  • Hi Scott,

    How about MVC Source Code?

    Thanks,
    Bart

  • Anyone else who has problems installing the update? I'm getting the following error:

    Returning IDOK. INSTALLMESSAGE_ERROR [Error [1].An installation package for the product [2] cannot be found. Try the installation again using a valid copy of the installation package '[3]'.: 1706Microsoft Visual Studio 2008 Professional Edition - ENU]

  • Can VS2005's IDE reference the source code?

  • Hi Scott,

    Why are you releasing this?

  • Very nice, thank you!

    One small question:
    Why is the Visual Studio 2008 QFE hotfix's publisher unknown?

  • This makes me laugh... a bit
    I was able to see and read .NET source code for at least a year already (since I started .NET programming), so what's the reason for that step? Allow the developers to step through it? That's the only single advantage, and it's not so huge, taking into account you're opening the source for only several libraries..

    The only reason we would like to see the code as it was written, is for .NET 3.5 libraries, but afaik they were also written in .NET 2... :)

    I don't hate Microsoft, but the things and choices they do are sometimes awfully.. bleh

  • Excellent. Easy to install. Works as advertised.

  • Great :) more F10 experience

  • What lisence has this code been released under?

  • Interresting and sweet!

    While talking about libraries, why the need to install the entire .net library on a computre that needs a few things from the library for your proudct to work? Space might not be a problem usually but I like keeping my stuff slim.

    Btw, if there is work being done with the CLR it would be very interresting to know about it! Like for instance how the CLR is to slow to manage more then 10k/seconds of splitting a string at a ','.

    Great blogg, keep up the nice work!

  • It's exiting news, I think it's a biggest development in history.

  • What is the license you are using for releasing this? Cause if it isn´t FOSS, it´s not worth it. It´s just a trap. Just like the Bush government.

  • Hey Now Scott,
    I think this is a really good direction to go. it just shows how Microsoft cares about the community by opening the .NET Framework.
    Thx 4 the info,
    Catto

  • Thank Goodness!!!
    What a hard step!!!

  • Great news! Much less spying with Reflector from now on :-)

  • Will this work with Visual Web developer 2008 express?

  • This is a big step for Microsoft. Great work, Scott! You're a legend.

  • Why do all these blogs show 100's of comments simply saying hi we seen your post?
    Is there some value in that to me the viewer?

  • What about Sharepoint assemblies?

  • Hey Scott,

    Does this include the LINQtoSQL source code?

    - Charles

  • Scott thanks for the update. Hope to hear more about this at mix08.
    mikedopp.net

  • Well, it's a start... but why do I get the feeling that this is going to become a problem for developers of projects like Mono? With the "read-only reference" license, it seems like Microsoft is simply trying to "poison the well", so to speak, for anybody who might try to duplicate the functionality of .NET on other platforms.

  • Hi Mr.Scott!
    I'm an asp.net beginner.
    I have a problem with my site, I thought you can help me.
    I'm working on a site for weblog, like this site!
    I want to give user "Edit" facilities.
    My problem is : When I use "FreeTextBox" control for editing "Text" field, be Null my database, but when I use normal TextBox, it's ok.
    I want to know what can I do?
    I'll be happy help me.
    My Email: princess_of_god86s@yahoo.com
    And have nice time!

  • if i'm developing MONO (which does also run under windows) may i look at the source? i mean i am developing for windows, just not exclusively (and the dev-box runs linux - gotta have a _work_station, not a gamestation)

  • Hmm, how its any better and provide more complete information then for example Reflector+Deblector ?

  • It's inspiring to see posts here in so many languages. It would be nifty if Hungarian displayed properly though.

  • Neat, but, can VS2005 users use this ?

  • Will source code to mscorlib be released?

  • Just so I'm clear on this, I'm NOT allowed to use this as a concept to develop something similar for unix based systems?

  • Hey - .NET is now where Java is since its first release.
    We can finally few the class libraries's source :)

  • Scott:

    Is there any plan for Compact Framework developers?

    I know we are only a few compared to the WinForms and ASP.NET devs, but we would really appreciate something like this and we know this doesnt implies a change for the CF Code, its just making it available.
    I have not seen any announcement about this in the CF Team Blog, but I hope they´re at least considering this.

    By the way, do you know something about the DLR and CF? Is not that I really need (like the source code), but just for curiosity.

  • Does this work with VS2005 also?

  • белые наступают!!!

  • Hi Scott,
    May I ask why when I close the VSTS the source files are removed? Thank you.

    -Boler

  • Very good!
    这里还有还有好多中国同胞~不错!

  • Hi Scott,

    Does this mean that we will be able to change and recompile the framework?

    Thanks,

    RobS.

  • Dear ScottGu,

    Very Good News.

    Thanks

  • I get a Page Not Found as a lot of other people are getting. When is the QFE uploaded to the Microsoft Downloads Center?

  • Sun Microsystems opened up all of Java under LGPL a long time ago. Seems to me, Microsoft needs to pick up the pace if they want to stay competitive in software market of the 21st century.

    Also, if you want the source code to a cross-platform .NET library, check out Mono.

  • Scott Guthrie has just posted the excellent news that everything is now in place for people to access

  • Nice to see this Scott.
    Congrats on the bold move. There's a zillion comments, but even if this one gets lost, I wanted to drop a note. This move will help us at InSTEDD use the .NET platform in environments where openness and transparency aren't just ideological buzzwords, but can make the difference between getting a system to work or not in a lives-at-stake situation. Keep this trend going!
    Thank you -
    ~ej

  • does stevie know about this???

  • Grt News!.... Thanks Scott and Team!... am sure, rest of the Microsoft Technology world going to enjoy this!...

  • Wow!!

    I am waiting for WCF libraries to come.

    Thanks

  • Awesome.

    Hello Scott , the first thing that came to my mind after reading this was 'Why now'?. Can we expect for a bigger suprise later on..;)



  • Why must we register to download this QFE?

  • Yeah, I am glad it is released. Nice.

  • Hi Scott,

    >> Yes - we'll be releasing the source and enabling debugging for the Silverlight libraries as well once they ship.

    I'm amazed! But as far as I know, some Silverlight libraries are unmanaged. Silverlight team at Silverlight.net told me once that the Shape, Transformation and other classes are in native code. Correct me if i'm wrong, the managed Silverlight libraries are just wrappers on top of unmanaged code.

    So I was wondering how the opening Silverlight source code would work, as there are libraries of unmanaged code. If only the managed source code is available, we will see only the source code of wrappers.

    Thanks
    Sopheap Ly

  • It is indeed a big step for Microsoft and definitely a good move for releasing out the .NET, PHP has been dominating the internet and it is time to gain back some market share.

  • Thanks! I was just looking for something like that!
    Great post!

  • wow,great, it make debug more easy.

  • Nothing but Programming

  • This is great new Scott. Does it mean that once the complete source is realeased, it can be used to compile the .net framework for Linux or any other operating system?

  • microsoft has done the great thing in the software field, introduction of the .NET is the new boom in the industry...has a great ability.

  • How to issues a build command to Visual Studio?
    Thanks

  • This is great news! I have been using Reflector to disassemble the .NET assemblies to get a better idea of the inner workings. Being able to see the actual code along with the developers comments will be great. I cannot wait for the source download to be made available.

  • I am not able to step into any of the classes within System.Data.dll. The core libraries work fine.

  • This is great. Just out of curiousity, is it only available for VS 2008? I'm still running 2005.

  • Any plans for supporting this feature for the Compact Framework. Remember it still is part of the .net framework, even though it is a subset of the desktop framework. I feel like the mobile development groups using compact framework are left in the dark when it comes to features and functionality like this. Any idea when the compact framework team are going get on board with the desktop framework team and offer this same debug feature.

    Thanks
    CD

  • I can't be mentioned often enough that the Compact Framework code would be very, helpful too. I spend many hours last week with a problem, that after saving a bitmap with the Bitmap class of the CF, it had somehow altered colors.

    I found some hints in the web, that this is caused by the internal representation (r5g5b5 instead of r5g6b5/r8g8b8) and finally saved it by own code.

    If I had the source code I could have solved it earlier.

    Because of the limitations of the CF the necessity to dig into the source code appears more often than with the full Framework...


  • Hi,

    is there any way, how to display downloaded sources in VS2005/8 and be able to browse them? I have not yet found an option, to attach sources for some referenced assembly provided that I have sources of that assembly somewhere on my drive.

    thanks

    marek

Comments have been disabled for this content.