Scott Hanselman

Announcing the new Roslyn-powered .NET Framework Reference Source

February 24, '14 Comments [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
Sponsored By
Hosting By
Dedicated Windows Server Hosting by ORCS Web
Monday, February 24, 2014 6:24:38 PM UTC
Wow this is very impressive from the team! As a C# developer I am excited about this site.
Curtis traverse
Monday, February 24, 2014 6:27:46 PM UTC
Killer.
Monday, February 24, 2014 6:37:52 PM UTC
This is awesome. Good job guys!
Monday, February 24, 2014 7:02:21 PM UTC
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.
PRMan
Monday, February 24, 2014 7:03:19 PM UTC
Friendly typo alert: "Fast forward to today...we've back" should be "we're back" I think.
Splendor
Monday, February 24, 2014 7:12:02 PM UTC
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.
Tony
Monday, February 24, 2014 7:39:09 PM UTC
Cool. I wish there were sources of ASP.NET Identity and other ASP.NET family assemblies.
Monday, February 24, 2014 7:51:08 PM UTC
@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.
Monday, February 24, 2014 8:15:49 PM UTC
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
Monday, February 24, 2014 8:21:39 PM UTC
@Cam, for example, here is what in ASP.NET Identity repo:

https://aspnetidentity.codeplex.com/SourceControl/latest
Monday, February 24, 2014 8:30:03 PM UTC
Roslyn is used to generate the index, including all those cross-references for identifiers etc.
int19h
Monday, February 24, 2014 8:34:59 PM UTC
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.
Tristan STW
Monday, February 24, 2014 8:51:48 PM UTC
Scott, This is wonderful news! On a side note is there any scheduled release date for Roslyn itself?
Stephen Brannan
Monday, February 24, 2014 9:18:14 PM UTC
Awesome! When to expect Roslyn to be released itself?
Monday, February 24, 2014 9:27:43 PM UTC
More giving away the crown jewels for free......
Average Joe
Monday, February 24, 2014 10:05:53 PM UTC
Roslyn rocks! I can hardly imagine the impact of Roslyn during the last decade!
Monday, February 24, 2014 10:17:48 PM UTC
Has to be said, that's pretty awesome indeed!
Sean Kearon
Monday, February 24, 2014 10:54:44 PM UTC
That made me feel like I've found a treasure.
Kemal Gültekin
Tuesday, February 25, 2014 12:54:42 AM UTC
Amazing, thank you very much!!
Tuesday, February 25, 2014 1:53:21 AM UTC
Hard to get enthused... beta software using beta software. release something already.
Sean
Tuesday, February 25, 2014 6:09:08 AM UTC
Wow, this is pretty awesome! I'm fairly certain I'm going to spend a lot of time on this site.
Tuesday, February 25, 2014 9:12:31 AM UTC
Any news about sdk assemblies for other MS products? (eg: Sharepoint, Project Server).
Will they ever be released like this?
Razvan
Tuesday, February 25, 2014 9:14:37 AM UTC
So this could be used to plug some of the gaps in Mono? If so, that's fantastic. Great work.
Tuesday, February 25, 2014 9:34:00 AM UTC
@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."
flargle
Tuesday, February 25, 2014 9:49:15 AM UTC
Awesome. Just awesome.
Fabrizio
Tuesday, February 25, 2014 11:39:54 AM UTC
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.
underpants
Tuesday, February 25, 2014 1:23:12 PM UTC
Freakin awesome !
Love it !
Thank you guys
Miiite
Tuesday, February 25, 2014 3:58:25 PM UTC
I'd love to see the navigation and search functions applied to the MSDN Library site! :-)
Spencer
Tuesday, February 25, 2014 6:09:02 PM UTC
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
Tuesday, February 25, 2014 6:32:26 PM UTC
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).
Wednesday, February 26, 2014 1:40:56 PM UTC
"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" :-)
Wednesday, February 26, 2014 1:47:07 PM UTC
Awesome!! thanks for update
Wednesday, February 26, 2014 11:02:47 PM UTC
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.
Paw Baltzersen
Friday, February 28, 2014 4:35:43 PM UTC
This is going to be an excellent set of reference when we want to dig through the internals and analyse how it operates.

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

wilmer barrios
Monday, March 31, 2014 2:00:29 AM UTC
Very nice blog post. I definitely appreciate this website.
Keep writing!

My blog like abby winters
Tuesday, April 01, 2014 11:36:06 PM UTC
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.
Thursday, April 03, 2014 2:24:49 PM UTC
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. . . . . .
Wednesday, May 14, 2014 3:57:42 PM UTC
Was possible with Java since V1.0... and integrated in the IDE, lol! C# is so lame...
Daniel
Comments are closed.

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