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

  • Hands On: New VS Code Insiders Build Creates Web Page from Image in Seconds

    New Vision support with GitHub Copilot in the latest Visual Studio Code Insiders build takes a user-supplied mockup image and creates a web page from it in seconds, handling all the HTML and CSS.

  • Naive Bayes Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the naive Bayes regression technique, where the goal is to predict a single numeric value. Compared to other machine learning regression techniques, naive Bayes regression is usually less accurate, but is simple, easy to implement and customize, works on both large and small datasets, is highly interpretable, and doesn't require tuning any hyperparameters.

  • VS Code Copilot Previews New GPT-4o AI Code Completion Model

    The 4o upgrade includes additional training on more than 275,000 high-quality public repositories in over 30 popular programming languages, said Microsoft-owned GitHub, which created the original "AI pair programmer" years ago.

  • Microsoft's Rust Embrace Continues with Azure SDK Beta

    "Rust's strong type system and ownership model help prevent common programming errors such as null pointer dereferencing and buffer overflows, leading to more secure and stable code."

  • Xcode IDE from Microsoft Archrival Apple Gets Copilot AI

    Just after expanding the reach of its Copilot AI coding assistant to the open-source Eclipse IDE, Microsoft showcased how it's going even further, providing details about a preview version for the Xcode IDE from archrival Apple.

Subscribe on YouTube

Upcoming Training Events