.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 ~\jupyter\kernels\.net-csharp
.net-fsharp ~\jupyter\kernels\.net-fsharp
.net-powershell ~\jupyter\kernels\.net-powershell
python3 ~\jupyter\kernels\python3
- 新建個項目並打開Jupyter Notebooks
mkdir yourapp
cd yourapp
jupyter notebook
- 現在可以愉快地使用了,截圖如下就OK了