News

.NET Interactive Now Does .NET Notebooks with VS Code

.NET Interactive users can now use a new Visual Studio Code Insiders experience to work with .NET Notebooks, in addition to other notebook options including Jupyter and nteract.

Formerly called Try .NET (for which there is still a site), the renamed .NET Interactive serves as an interactive documentation generator for .NET Core, providing CLI tools and APIs to let users create interactive experiences across the web, markdown and notebooks.

As mentioned, the popular Jupyter Notebook scheme was previously supported, widely used for use cases including data science, documentation, DevOps and more.

The new VS Code option comes in the just-shipped .NET Interactive Preview 3, announced Sept. 30 by Maria Naggaga, senior program manager.

"In .NET Interactive Preview 2, we announced that in addition to Jupyter Notebook and Jupyter Lab, users could use nteract as well. In this preview, users can add VS Code Insiders to that list. With the VS Code Insiders experience, users can get started with .NET notebooks without needing to install Jupyter. The VS Code experience is still a work in progress, and is only available in VS Code Insiders."

.NET Interactive's GitHub site now lists the following options for sharing code, exploring data, learning and writing apps:

Naggaga also announced the new ability to leverage .NET Interactive polyglot notebooks, taking advantage of the project's multi-language kernel that allows for the creation of notebooks that use different languages together. "You switch languages from one cell to another, as appropriate to the task at hand," she said. "Pulling values into the notebook and moving values between languages are useful capabilities, which we've enabled with a pair of magic commands: #!share and #!value."

The ability to declare a C# variable in a cell and then share it with F# using the above #!share command is shown in this animated GIF:

Sharing a C# Variable with F# Code in Animated Action
[Click on image for larger, animated GIF view.] Sharing a C# Variable with F# Code in Animated Action (source: Microsoft).

.NET Interactive for VS Code is provided by an extension in the VS Code Marketplace, which is in the preview stage, thus prompting the warning: "The Visual Studio Code notebook support that this extension uses is also in preview and design is ongoing, so the extension might not work." It had been installed 2,889 times at the time of this writing.

Other resources include documentation and code samples.

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube