.NET Interactive发布预览版了,可以像Python那样用jupyter notebooks来编辑C#代码。具体可以在GitHub上查看dotnet/interactive项目。
安装步骤
- 安装好.NET Core 3.1 SDK
- 安装好Python 3(默认有pip)
- 安装Jupyter
pip install jupyter
- 在命令行检查Jupyter是否正确安装
jupyter kernelspec list
- 可以安装.NET Interactive了
dotnet tool install -g --add-source "https://dotnet.myget.org/F/dotnet-try/api/v3/index.json" Microsoft.dotnet-interactive
dotnet interactive jupyter install
- 再次用
jupyter kernelspec list
查看检查安装好的.NET版本Jupyter,输出如下
.net-csharp ~jupyterkernels.net-csharp
.net-fsharp ~jupyterkernels.net-fsharp
.net-powershell ~jupyterkernels.net-powershell
python3 ~jupyterkernelspython3
- 新建个项目并打开Jupyter Notebooks
mkdir yourapp
cd yourapp
jupyter notebook
- 现在可以愉快地使用了,截图如下就OK了