dotnet / interactive

.NET Interactive combines the power of .NET with many other languages to create notebooks, REPLs, and embedded coding experiences. Share code, explore data, write, and learn across your apps in ways you couldn't before.
MIT License
2.9k stars 387 forks source link

Can't open or create .Net Interactive notebook #1872

Closed dcuccia closed 2 years ago

dcuccia commented 2 years ago

On a clean Windows 11 install of VS Code (or Insiders), and installation of .Net Interactive notebooks, I can't create or open .Net Interactive notebooks. I'm not sure if this is different from #1813.

.Net Interactive 1.0.2462010 is the latest version that opens a UI when I select "Create a new .Net Interactive Notebook". Newer versions just hang with the message "Activating Extensions..." which seems to time out after a couple seconds:

image

But even if a notebook (.dib or .ipynb) is created with the earlier versions, I can't seem to execute any C# code - kernel execution hangs on a Hello World.

Tried installing the .Net 5 SDK, just in case, but that didn't help. Here's my full set of .Nets:

PS C:\> dotnet --list-sdks
3.1.416 [C:\Program Files\dotnet\sdk]
5.0.404 [C:\Program Files\dotnet\sdk]
6.0.101 [C:\Program Files\dotnet\sdk]
6.0.200-preview.22055.15 [C:\Program Files\dotnet\sdk]

Repro'd on VS Code:

Version: 1.63.2 (user setup) Commit: 899d46d82c4c95423fb7e10e68eba52050e30ba3 Date: 2021-12-15T09:40:02.816Z Electron: 13.5.2 Chromium: 91.0.4472.164 Node.js: 14.16.0 V8: 9.1.269.39-electron.0 OS: Windows_NT x64 10.0.22000

...and VS Code Insiders:

Version: 1.64.0-insider (user setup) Commit: c6e58d126f6b5676242e32b34180b2a595f29b51 Date: 2022-01-14T05:19:33.429Z Electron: 13.5.2 Chromium: 91.0.4472.164 Node.js: 14.16.0 V8: 9.1.269.39-electron.0 OS: Windows_NT x64 10.0.22000

What can I do to help track down? Should I create a separate ticket? I've grown so comfortable using .Net Interactive in my daily workflow, I'm at a loss for what to do!

profix898 commented 2 years ago

Same here. Can't use any .NET Interactive at the moment ... I'm on VS Code 1.63.2. I noticed that both of us have a 6.0.200-preview version installed (in addition to latest 6.0.100).

jonsequitur commented 2 years ago

Could you post the output of dotnet --info?

dcuccia commented 2 years ago

Absolutely. See below (just updated Visual Studio 2022 to 17.1.0 Preview 4.0) and the same issue persists:

PS C:\> dotnet --info
.NET SDK (reflecting any global.json):
 Version:   6.0.200-preview.22055.15
 Commit:    a3c3a2bf3b

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.22000
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\6.0.200-preview.22055.15\

Host (useful for support):
  Version: 6.0.1
  Commit:  3a25a7f1cc

.NET SDKs installed:
  3.1.416 [C:\Program Files\dotnet\sdk]
  5.0.404 [C:\Program Files\dotnet\sdk]
  6.0.101 [C:\Program Files\dotnet\sdk]
  6.0.200-preview.22055.15 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.12 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.13 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET runtimes or SDKs:
  https://aka.ms/dotnet-download
profix898 commented 2 years ago

Mine looks almost identical, except that .NET 5 is not installed (otherwise same Windows version, same .NET SDKs, etc.)

jonsequitur commented 2 years ago

@dcuccia That's identical to mine and I'm not seeing any issues. Let's take a look at VS Code setup.

Have you customized anything in settings.json related to .NET Interactive? (I haven't.)

image

Another possibility: I wonder if another VS Code extension might be interfering. Do you have any other notebook-related extensions installed? Here's what I'm running.

> code --list-extensions
andriniaina.fsharp-interactive-datascience
anotherglitchinthematrix.monochrome
dhedgecock.radical-vscode
eamodio.gitlens
earshinov.filter-lines
GitHub.copilot
GitHub.remotehub
GitHub.vscode-pull-request-github
Ionide.Ionide-fsharp
mariorodeghiero.vue-theme
mel-brown.deep-purple
ms-dotnettools.csharp
ms-dotnettools.dotnet-interactive-vscode
ms-python.python
ms-python.vscode-pylance
ms-toolsai.jupyter
ms-toolsai.jupyter-keymap
ms-toolsai.jupyter-renderers
ms-vscode-remote.remote-wsl
ms-vsliveshare.vsliveshare
RandomFractalsInc.vscode-data-preview
RandomFractalsInc.vscode-data-table
samrapdev.outrun
tchayen.markdown-links
yzhang.markdown-all-in-one
jonsequitur commented 2 years ago

@brettfo 👀

profix898 commented 2 years ago

I have the following VS Code extensions installed:

> code --list-extensions
christian-kohler.path-intellisense
cschlosser.doxdocgen
DotJoshJohnson.xml
eamodio.gitlens
EditorConfig.EditorConfig
formulahendry.code-runner
jeff-hykin.better-cpp-syntax
krvajalm.linter-gfortran
ms-dotnettools.csharp
ms-dotnettools.dotnet-interactive-vscode
ms-dotnettools.vscode-dotnet-runtime
ms-python.python
ms-python.vscode-pylance
ms-toolsai.jupyter
ms-toolsai.jupyter-keymap
ms-vscode-remote.remote-containers
ms-vscode-remote.remote-ssh
ms-vscode-remote.remote-ssh-edit
ms-vscode-remote.remote-wsl
ms-vscode.cmake-tools
ms-vscode.cpptools
ms-vscode.cpptools-extension-pack
ms-vscode.cpptools-themes
ms-vscode.powershell
ms-vsliveshare.vsliveshare
mutantdino.resourcemonitor
PKief.material-icon-theme
tht13.html-preview-vscode
vscode-icons-team.vscode-icons
vsls-contrib.codetour
yzhang.markdown-all-in-one

I can actually load an existing notebook file, but I noticed that C# is missing from the list of available languages for the code cells. It only has Markdown and Python (and it always falls back to Python when I try to execute the cell).

dcuccia commented 2 years ago

@jonsequitur no custom settings - brand new install: image

Here are my extensions (am I missing any I might need?):

PS C:\Users\dcucc> code --list-extensions
ms-dotnettools.csharp
ms-dotnettools.dotnet-interactive-vscode
ms-toolsai.jupyter
jonsequitur commented 2 years ago

@profix898 Which kernel are you seeing selected here? image

profix898 commented 2 years ago

@jonsequitur There is only Python 3.9.7 in the list ... Looks like .NET Interactive is not "registered" correctly.

Previously (before moving to Win 11 and fresh install) I always had Jupyter and the dotnet interactive global tool installed as well. But that should not be necessary, right? Will try anyway and report back. But, just VS Code + Extension + SDK should do it, right?

dcuccia commented 2 years ago

Not sure if this is helpful, but opening an existing .ipynb file with Powershell code does not give me a .Net Interactive kernel choice: image

jonsequitur commented 2 years ago

@profix898 The .NET Interactive Notebooks extension depends on the Jupyter extension. It doesn't depend on Python though.

brettfo commented 2 years ago

The root cause is here: dotnet/sdk#23687

The only workaround is to uninstall, or otherwise disable, the 6.0.200-preview.22055.15 sdk.

dcuccia commented 2 years ago

@brettfo bingo! repro'd that ticket's behavior. Unfortunately, I can't figure out a way to uninstall the 6.0.200-preview.22055.15 SDK, either through Version 17.1.0 Preview 4.0 individual components:

image

...or via dotnet-core-uninstall:

PS C:\>dotnet-core-uninstall list

This tool cannot uninstall versions of the runtime or SDK that are 
    - SDKs installed using Visual Studio 2019 Update 3 or later.
    - SDKs and runtimes installed via zip/scripts.
    - Runtimes installed with SDKs (these should be removed by removing that SDK).
The versions that can be uninstalled with this tool are:

.NET Core SDKs:
  6.0.101  x64    [Used by Visual Studio. Specify individually or use --force to remove]
  5.0.404  x64
  3.1.416  x64

.NET Core Runtimes:

ASP.NET Core Runtimes:
  5.0.13  x86
  5.0.13  x64

.NET Core Runtime & Hosting Bundles:

Assume this means I have to choose between .Net Interactive and VS 2022 preview bits, for now.

dcuccia commented 2 years ago

Confirming removing VS 2022 Preview resolves this issue. So it's MAUI or Interactive for now (FWIW, I chose Interactive :)).

dcuccia commented 2 years ago

@jonsequitur is this resolved?

jonsequitur commented 2 years ago

I'm not able to repro this with the latest VS 2022 Previews installed. Are you still seeing it?

dcuccia commented 2 years ago

@jonsequitur you're right - I can't either, great news! Probably means this wasn't the root cause after all?

jonsequitur commented 2 years ago

Probably not related, since .NET Interactive isn't using dotnet run.