Skip to content
| Marketplace
Sign in
Visual Studio>Tools>Interactive Notebooks
Interactive Notebooks

Interactive Notebooks

Mads Kristensen

|
340 installs
| (0) | Free
Interactive notebook experience for Visual Studio. Execute C#, JavaScript, and SQL code in cells with rich output, IntelliSense, and cross-language variable sharing. Powered by .NET Interactive.
Download

Polyglot Notebooks for Visual Studio

Build

Download this extension from the Visual Studio Marketplace or get the latest CI build from Open VSIX Gallery.


Write and run C#, JavaScript, SQL, and more — right inside Visual Studio. Polyglot Notebooks brings an interactive notebook experience to the IDE you already know, powered by .NET Interactive. Mix languages in a single document, share variables across cells, and see rich output instantly.

Notebook editor

📖 Read the full documentation — getting started guide, feature walkthroughs, keyboard shortcuts, and troubleshooting.

What You Get

Multi-language cells - Write C#, JavaScript, and SQL side by side in one notebook. Switch languages per cell with a dropdown or #! magic commands.

Standard notebook formats - Open and save .dib and .ipynb files. Share notebooks with VS Code users and Jupyter workflows without conversion.

Rich output - See HTML, images, tables, and formatted text rendered directly below each cell. No console window needed.

IntelliSense everywhere - Get completions, signature help, and diagnostics in every code cell — the same editing experience you expect from Visual Studio.

Cell-level debugging - Debug C# and F# cells with the full Visual Studio debugger. Step through your cell code line by line, inspect variables, and hit breakpoints — right from the notebook editor.

Cross-language variable sharing - Define a variable in C# and use it in JavaScript. The kernel handles the data transfer automatically.

Variable Explorer

Document Outline - See the structure of your notebook at a glance in the standard Document Outline window. Markdown headings group related code cells into a navigable tree.

Zero setup - The extension detects and installs dotnet-interactive automatically when needed. Open a notebook file and start coding.

Workspace-aware references - Notebooks that belong to a project in your solution automatically get access to the project's types and NuGet packages — no #r directives needed. IntelliSense works for your own code too.

Item template - Create new .dib notebooks directly from the Add New Item dialog. No need to leave the IDE or copy files manually.

Getting Started

Create a New Notebook

Right-click a project or folder in Solution Explorer and select Add > New Item. Search for Polyglot Notebook in the template list. The template creates a .dib file with an empty C# code cell so you can start writing immediately.

Open a Notebook

Double-click any .dib or .ipynb file in Solution Explorer, or use File > Open > File to open one from disk. The notebook editor opens with your cells ready to run.

Write and Run Code

Type code in any cell and press Shift+Enter to execute. Output appears directly below the cell. Use the ▶ button or the run dropdown for more options like Run Cells Above, Run Cell and Below, and Debug Cell.

Cell execution

Switch Languages

Each cell has a language selector in its toolbar. Pick C#, JavaScript, SQL, or another available kernel. You can also type #!csharp, #!javascript, or #!sql on the first line to set the language.

Inspect Variables

Open View > Variable Explorer to see every variable across all kernels. Click any row to see its full value in the detail pane. Hit Refresh after running cells to update.

Navigate with Document Outline

Open View > Other Windows > Document Outline to see a tree view of your notebook. Markdown cells act as section headings with code cells nested beneath them. Click any item to jump straight to that cell.

Manage the Notebook

The toolbar at the top of the editor gives you quick access to common actions:

  • Run All - Execute every cell from top to bottom
  • Restart + Run All - Restart the kernel and re-run everything
  • Interrupt - Stop a long-running cell
  • Restart Kernel - Reset kernel state without running cells
  • Clear All Outputs - Remove all cell outputs at once

Use Your Project's Types in Notebooks

When a notebook file (.dib or .ipynb) is part of a project in your solution, the extension automatically makes the solution's assemblies and NuGet packages available in the kernel. You can use your own types and packages in notebook cells without writing any #r directives:

// No #r needed — MyProject.dll and its NuGet packages are already loaded
using MyProject.Models;

var customer = new Customer("Contoso", "contoso@example.com");
display(customer);

This only activates when the notebook is included in a project via Solution Explorer. Standalone notebooks opened from File > Open are not affected. Projects must target modern .NET (net6.0+) or .NET Standard (netstandard2.0/2.1). .NET Framework projects (net48) are not reliably supported because the kernel runs on modern .NET — see Running Code for details.

After rebuilding your project, use Restart Kernel to pick up the new assemblies — the kernel can't hot-reload already-loaded DLLs.

Organize Cells

Use the cell menu (···) to insert, move, or delete cells. Drag-and-drop reordering keeps your notebook tidy.

Keyboard Shortcuts

Action Shortcut
Run cell and advance Shift+Enter
Run all cells Ctrl+Shift+Enter
Clear cell output Ctrl+Shift+Backspace
Interrupt execution Ctrl+.

Example Notebooks

The examples/ folder includes ready-to-run notebooks to get you started:

  • hello-world.dib - Your first notebook — a quick C# "Hello, World!"
  • variable-sharing.dib - Share data between C# and JavaScript cells
  • rich-output.dib - Render HTML, tables, and images in cell output
  • multi-language.dib - Mix C#, JavaScript, and SQL in one document
  • data-exploration.dib - Query and visualize data interactively
  • basic-csharp.ipynb - C# fundamentals in Jupyter notebook format
  • fsharp-notebook.ipynb - F# cells in a .ipynb file

How It Works

Polyglot Notebooks uses dotnet-interactive as its execution engine. When you open a notebook, the extension starts a kernel process in the background. Each cell's code is sent to the appropriate language kernel, and results stream back as rich output.

If dotnet-interactive isn't installed, the extension offers to install it for you automatically — no terminal commands required.

Contribute

For build instructions, architecture overview, and PR guidelines, see CONTRIBUTING.md.

Issues, ideas, and pull requests are welcome.

License

Apache 2.0

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft