Scott Hanselman

Announcing the new Roslyn-powered .NET Framework Reference Source

February 24, 2014 Comment on this post [40] Posted in Musings
Sponsored By

.NET Framework Reference Source SiteIn 2007 ScottGu's team announced they were releasing the .NET Framework source code for reference. Just a little later, Microsoft made it possible to step through the .NET Framework Source code while debugging. This was announced to much fanfare, and for a while, it was very cool. It wasn't "Open Source" but it's definitely "Source Opened."

However, as time passed, the original Reference Source website for the .NET Framework sucked for a number of reasons, mostly because it wasn't updated often enough.

Fast forward to today...we're back and the .NET team is launching the fresh new and updated .NET Reference Source site with a Roslyn-powered index!

The new beta site is at http://referencesource-beta.microsoft.com and it'll move over to replace the existing http://referencesource.microsoft.com site soon.

It's easy to browse the code, but if you'd prefer you can also download the .NET Framework source in a ZIP from the download link at the top of the site.

The Roslyn-powered .NET Reference Source browser

There's some very cool .NET-related stuff happening this year, and you'll be hearing about it all soon. The new "Roslyn" compiler-as-a-service replacements for the C# and VB compilers have had the "Big Switch" flipped. We're now getting an amazing totally-rewritten managed compiler that can enable features that weren't possible when .NET started over a decade ago.

Today there's a new team working on the .NET Reference Source, and Roslyn let the team generate a complete syntactic and semantic index of the .NET Framework Sources.

From the team: The version of the framework that we currently have indexed is .NET framework version 4.5.1.  If this is something that folks agree is useful, our ongoing commitment towards this feature is to update this every major release i.e. an update for 4.5.2 and so on.  

This is a crucial feature, IMHO, and they are recommitted to making it happen, and most importantly, keeping it fresh and updated. They are also thinking about maybe using the Monaco editor for the site as well.

Be sure to explore the browser and click on everything, as there's a lot more there than just "search box and results."

Here's a few cool things you can do with the URLS on the new site that you should explore. I like being able to reference a line number in the URL for tweeting or IM'ing.

There's also a lot of flexibility in the search:

You can also actually click on types directly within the editor and find where they are referenced in the code.

clip_image002

They will switch the beta site at http://referencesource-beta.microsoft.com/ to take over the existing Reference Source site soon. Until then, use the Feedback link on the site and email the team directly! They are listening and actively working on this site.

The next thing the team is working on, and they are very close, is getting .NET Source Stepping (meaning you can just F11 into the .NET source code) to again work reliably when debugging, no matter what patch version you have of the .NET Framework on your local machine. Look for that in a few days on the .NET Team Blog.

BONUS: Community Visual Studio Extension

Here's an exciting bonus. Community member and fabulous coder Schabse Laks has created a Visual Studio extension for VS2010, 2012, and 2013! This extension sends calls to Go To Definition (or pressing F12 on a symbol) directly to the code online (when it's .NET Framework code, not yours).

You can download this companion "Ref12" Visual Studio Extension now! Just Goto Definition on any .NET type we have source for and it'll launch your default browser so you can explore the .NET Framework source yourself! Thanks Schabse!

.NET Reference Source Code Licensing Clarified

Finally, the licensing before was originally the very straightforward Microsoft Reference Source License,  but then started to get other caveats tacked on like "don't look at this if you aren't using Windows" until it wasn't really the MS-RSL at all.

They've changed that stuff. They're back to the straight MS-RSL which is easy to read and clear. This means that folks can now look at this Reference Source and not have to gouge their eyes out afterwards. Which is great!

We all hope you like the new site and the team looks forward to your comments!


Sponsor: Big thanks to Red Gate for sponsoring the blog feed this week! Easy release management: Deploy your SQL Server databases in a single, repeatable process with Red Gate’s Deployment Manager. There’s a free Starter edition, so get started now!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Hosting By
Hosted in an Azure App Service
February 24, 2014 22:24
Wow this is very impressive from the team! As a C# developer I am excited about this site.
February 24, 2014 22:27
Killer.
February 24, 2014 22:37
This is awesome. Good job guys!
February 24, 2014 23:02
Ref12 works for F12, but not for what I usually use, which is right click and select Go To Definition from the context menu, which still takes you to metadata.

Any way to get in touch with the developer? Looks like a pretty cool workaround in the meantime.
February 24, 2014 23:03
Friendly typo alert: "Fast forward to today...we've back" should be "we're back" I think.
February 24, 2014 23:12
So how is Roslyn used on this website? I'm curious why a static index of source code needs to be generating and compiling code on the fly.
February 24, 2014 23:39
Cool. I wish there were sources of ASP.NET Identity and other ASP.NET family assemblies.
February 24, 2014 23:51
@konstantin

Almost all of ASP.NET is open source on github, why would you need a kludge to see source when the actual source is just a click away?

I do agree in principal though, all those fancy NuGet packages that MS distributes it would be nice to browse the source through this same facility so you had a common place when doing basic debugging.
Cam
February 25, 2014 0:15
Awesome news. Huge improvement over the current version.

"There's some very cool .NET-related stuff happening this year, and you'll be hearing about it all soon."

What tortuous words...
Sam
February 25, 2014 0:21
@Cam, for example, here is what in ASP.NET Identity repo:

https://aspnetidentity.codeplex.com/SourceControl/latest
February 25, 2014 0:30
Roslyn is used to generate the index, including all those cross-references for identifiers etc.
February 25, 2014 0:34
Great news. Yuo should add to VS functionality of Ref12, to open source within VS, not in browser. Also, make it open for anyone who create library and want to show ssource code for others.
February 25, 2014 0:51
Scott, This is wonderful news! On a side note is there any scheduled release date for Roslyn itself?
February 25, 2014 1:18
Awesome! When to expect Roslyn to be released itself?
February 25, 2014 1:27
More giving away the crown jewels for free......
February 25, 2014 2:05
Roslyn rocks! I can hardly imagine the impact of Roslyn during the last decade!
February 25, 2014 2:17
Has to be said, that's pretty awesome indeed!
February 25, 2014 2:54
That made me feel like I've found a treasure.
February 25, 2014 4:54
Amazing, thank you very much!!
February 25, 2014 5:53
Hard to get enthused... beta software using beta software. release something already.
February 25, 2014 10:09
Wow, this is pretty awesome! I'm fairly certain I'm going to spend a lot of time on this site.
February 25, 2014 13:12
Any news about sdk assemblies for other MS products? (eg: Sharepoint, Project Server).
Will they ever be released like this?
February 25, 2014 13:14
So this could be used to plug some of the gaps in Mono? If so, that's fantastic. Great work.
February 25, 2014 13:34
@Tony So how do you think the "static index" was built in the first place?

"Today there's a new team working on the .NET Reference Source, and Roslyn let the team generate a complete syntactic and semantic index of the .NET Framework Sources."
February 25, 2014 13:49
Awesome. Just awesome.
February 25, 2014 15:39
Am I missing something?

As a user of open-source, I am accustomed to expect being able to step-though library source code.

However, I honestly can't see the meat behind the hype. As a C# developer, how exactly is "Roslyn" going to help me get my work done?

Call me old school, but I can't think that something is good just because people tell me so without seeing why.
February 25, 2014 17:23
Freakin awesome !
Love it !
Thank you guys
February 25, 2014 19:58
I'd love to see the navigation and search functions applied to the MSDN Library site! :-)
February 25, 2014 22:09
This is pretty cool - but is ROSLYN still being developed? We'd been using it a bit but once we migrated to Visual Studio 2013 it was no longer able to work with the .sln files.

Manually editing the .sln to indicate an earlier version of Visual Studio allows it to load and it seems to work as expected, but I took that as a bad sign as to Roslyn's future.

Rob
February 25, 2014 22:32
They've changed that stuff. They're back to the MS-RSL which is easy to read and clear. This means that folks like the Mono team could look at this Reference Source and not have to gouge their eyes out afterwards. Which is great!


I'm sorry but I don't see how this can be helpful to Mono developers. MS-RSL is still a non opensource license (according to OSI), so it cannot be mixed with MIT/X11 code (which is what Mono mainly requires for their contributions).
February 26, 2014 17:40
"There's some very cool .NET-related stuff happening this year, and you'll be hearing about it all soon."


> I hope that translates to "Releasing Roslyn at Build 2014" :-)
February 26, 2014 17:47
Awesome!! thanks for update
February 27, 2014 3:02
We've been able to do this with Resharper for quite some time now, and keep it inside VS :p
But still cool for all those who don't have Resharper. Thumbs up.
February 28, 2014 20:35
This is going to be an excellent set of reference when we want to dig through the internals and analyse how it operates.

March 02, 2014 5:24
This is fantastic! I'm reviewing some of the code for the Regex class since I have a vested interest in that piece.
March 29, 2014 8:16
MICROSOFT POWER ROSLYN
those interested in seeing the power of roslyn
send mail to wilmer1104@yahoo.com
send them to the great example

March 31, 2014 6:00
Very nice blog post. I definitely appreciate this website.
Keep writing!

My blog like abby winters
April 02, 2014 3:36
There are other models which work usong vibration and also buzzing and click trainers.

Again, we experienced this aggressive behavior with Andre.

Dogss find it much harder to break existing bad haits than to learn new,
positive ones.
April 03, 2014 18:24
Hey very cool website!! Guy .. Excellent .. Wonderful ..

I will bookmark your web site and take the feeds also?
I am glad to search out so many useful info right here within the put
up, we'd like develop more strategies on this regard, thanks for
sharing. . . . . .
May 14, 2014 19:57
Was possible with Java since V1.0... and integrated in the IDE, lol! C# is so lame...

Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.