1. Glossary
- Interactive
Interactive means that after entering code, you can directly run the code, and then continuously input and run code.
- Interactive .NET
.NET is a compiled language, unlike script languages such as Python, which can run results as you type code. Fortunately, Microsoft has launched the interactive project, making interactive .NET possible.
- Role of Interactive .NET
Interactive .NET can parse markdown, execute local commands (e.g., PowerShell), and execute .NET code. Therefore, it is very suitable for writing lesson plans or recording key code. The generated ipynb file can be uploaded to platforms like GitHub, making it very convenient for reference.
2. Installation Setup
You need to install Visual Studio Code and .NET 5 or later first. Then, install the .NET Interactive Notebooks extension in Visual Studio Code. You can search for .NET Interactive Notebooks in Visual Studio Code to install it:

3. Usage Guide
- Create a New Notebook
Use the hotkey Ctrl+Shift+P, then select .NET Interactive: Create new blank notebook

Or directly use the hotkey Ctrl+Shift+Alt+N, then select Create as '.ipynb'

Select C# as the language

- Parse Markdown
Enter a piece of markdown content, and select Markdown in the bottom right corner

Use the hotkey Alt+Enter to view the result

- Execute C# Code
Enter a piece of C# code, and select C# in the bottom right corner

Use the hotkey Alt+Enter or click the "Run" button on the left to view the output

You can reference related dependencies using the using keyword

- Execute Local Commands
Enter a local command, and select PowerShell in the bottom right corner. Use the hotkey Alt+Enter or click the "Run" button on the left to view the output

- Get .NET Version via Code

- Save ipynb File and Upload to GitHub
Use the hotkey Ctrl+S to save the ipynb file locally. Later, you can open it with Visual Studio Code to view and re-run the code

Then upload the ipynb file to GitHub

You can view an example at https://github.com/ErikXu/Blogs/blob/master/ipynb/dotnet-interactive.ipynb
4. Reference Summary
The above is what this article intends to share. The interactive GitHub repository is at: https://github.com/dotnet/interactive
If you have any questions, feel free to leave a message in the official account - 跬步之巅 (Kuibu Zhidian).