.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 for Converge360.

comments powered by Disqus


Subscribe on YouTube