News

.NET Framework Reference Source Updated Via 'Roslyn'

Developers can search for incompatibilities between their own code and .NET more easily than ever.

Have you ever upgraded to a newer version of Microsoft's .NET Framework, and suddenly found that one of your applications started acting buggy, or quit working altogether? It was very likely due to changes made in the .NET source code, and forced developers to spend long hours combing through code -- both their own and Microsoft's, in many cases -- to spot the changes.

Microsoft is working to change that. It has long had its .NET source code open to the public -- since 2007, reports Principal Program Manager Scott Hanselman on his blog -- but its value was limited because of infrequent updates. Officially called the ".NET Reference Source," it's being replaced by a newer version using the "Roslyn" compiler-as-a-service technology. Using Roslyn, Hanselman writes, generates "...a complete syntactic and semantic index of the .NET Framework Sources." The upshot is that every time the .NET Framework is updated, the .NET Reference Source will be updated as well.

Not only will the .NET source code be updated as often as .NET itself, but other updates will make it integrate better with Visual Studio. Alok Shriram, Program Manager on the .NET Framework team, wrote that well-known developer Schabse S. Laks has written a Visual Studio plug-in called "Ref12" that enables access to the .NET Framework Source by pressing F12 within the IDE (note that this is currently available only for C#; Visual Basic isn't supported, although Laks indicated a willingness to make it available, if it's requested.)

For those not working in Visual Studio, the .NET Framework Source can still be searched within a Web browser with a tool that gives "Go to Definition" and "Find All References"-like functionality. The .NET Framework Source is also available as a zip file, so developers wanting to work offline can still use it (it can be opened in Visual Studio).

Shriram explained how the new process will work:

"Starting with .NET 4.5.1 we have radically changed the symbol indexing and publishing process to be in sync with the build process such that as and when updates are shipped , the corresponding PDBs (Program Databases) are also updated to the reference source site appropriately. The summary of this is going forward the reference source debugging experience should just work."

The new .NET Framework Source site is still in beta; Hanselman blogged that it will "soon" replace the existing Source site.  

Roslyn is the project to fully rewrite the Visual Basic and C# compilers and language services (i.e. the language editing experiences) in their own respective managed code language; Visual Basic was rewritten in Visual Basic, and C# was rewritten in C#. It was officially enabled last December, according to Matt Gertz, the Visual Studio Managed Languages Development Manager. He wrote that the daily builds of Visual Studio are now compiled using Roslyn.

Roslyn exposes information regarding source code parsing (what elements are present in code), semantic analysis (what they mean), binding (how they relate to each other), and IL emitting (executable code).

About the Author

Keith Ward is the editor in chief of Virtualization & Cloud Review. Follow him on Twitter @VirtReviewKeith.

comments powered by Disqus

Featured

  • Build Your First AI Applications with Local AI

    "AI right now feels like a vast space which can be hard to jump into," says Craig Loewen, a senior product manager at Microsoft who is helping devs unsure about making that first daunting leap.

  • On Blazor Component Reusability - From Day 0

    "We want to try to design from Day One, even Day Zero, with reusability in mind," says Blazor expert Allen Conway in imparting his expertise to an audience of hundreds in an online tech event on Tuesday.

  • Decision Tree Regression from Scratch Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of decision tree regression using the C# language. Unlike most implementations, this one does not use recursion or pointers, which makes the code easy to understand and modify.

  • Visual Studio's AI Future: Copilot .NET Upgrades and More

    At this week's Microsoft Ignite conference, the Visual Studio team showed off a future AI-powered IDE that will leverage GitHub Copilot for legacy app .NET upgrades, along with several more cutting-edge features.

  • PowerShell Gets AI-ified in 'AI Shell' Preview

    Eschewing the term "Copilot," Microsoft introduced a new AI-powered tool for PowerShell called "AI Shell," available in preview.

Subscribe on YouTube