Announcing the new Roslyn-powered .NET Framework Reference Source
In 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.
- Link to assembly /#System.Core
- Link to file /#mscorlib/system/environment.cs
- Link to line number /#mscorlib/system/environment.cs#56
- Link to a type/member /mscorlib/a.html#1f55292c3174123d (right-click the definition and choose Copy Shortcut)
- Link to search results /#q=Button%20PresentationFramework
There's also a lot of flexibility in the search:
- Search for any full or partial type, or member name.
- Add any keyword like assembly, type, class, struct to filter the results
- Find projects by path like ndp\fx\src\data
- Find string literals like GUIDs: 03973551-57A1-3900-A2B5-9083E3FF2943
You can also actually click on types directly within the editor and find where they are referenced in the code.
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.
About Newsletter
Any way to get in touch with the developer? Looks like a pretty cool workaround in the meantime.
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.
"There's some very cool .NET-related stuff happening this year, and you'll be hearing about it all soon."
What tortuous words...
https://aspnetidentity.codeplex.com/SourceControl/latest
Will they ever be released like this?
"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."
As a user of open-source, I
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.
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.
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).
"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" :-)
But still cool for all those who don't have Resharper. Thumbs up.
those interested in seeing the power of roslyn
send mail to wilmer1104@yahoo.com
send them to the great example
Again, we experienced this aggressive behavior with Andre.
Dogss find it much harder to break existing bad haits than to learn new,
positive ones.
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. . . . . .
Comments are closed.