Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not getting a notebook interface when I create a .dib file in Visual Studio Code Insiders #514

Closed
2 of 14 tasks
alexandair opened this issue Jun 8, 2020 · 29 comments · Fixed by #541
Closed
2 of 14 tasks

Comments

@alexandair
Copy link
Contributor

Describe the bug

I'm following the steps for enabling .NET Interactive notebooks in Code Insiders, and I cannot get a notebook interface.

  1. Installed Code Insiders
  2. Installed PowerShell Preview extension (tried with the stable version too)
  3. Installed .NET Interactive notebooks extension
  4. Created a new file and saved it with the extension .dib
    Nothing happens.

If I try to open .dib file created by someone else, I get the "Unable to open 'test.dib': Cannot read property 'message' of undefined." error message.
If I disable PowerShell extension, I can at least open test.dib file as a textual file.

Please complete the following:

Which version of .NET Interactive are you using? There are a few ways to find this out:

  • In VS Code, run "Report installed version for .NET Interactive` and copy the version number from the status popup.

That command doesn't exist.

  • OS
    • Windows 10
    • macOS
    • Linux (Please specify distro)
    • iOS
    • Android
  • Browser
    • Chrome
    • Edge
    • Firefox
    • Safari
  • Frontend
    • Jupyter Notebook
    • Jupyter Lab
    • nteract
    • Visual Studio Code
    • Other (please specify)

Screenshots

If applicable, add screenshots to help explain your problem.

@jonsequitur
Copy link
Contributor

Which version of the .NET Interactive Notebooks extension are you using?

image

@alexandair
Copy link
Contributor Author

v1.0.130603
Installed today. Code Insiders is also installed today.

@colombod
Copy link
Member

@alexandair do you still see the issue?

@alexandair
Copy link
Contributor Author

@colombod
Yes. I've updated to the latest version of the extension and Code Insiders and I still cannot get the notebook UI or open a .dib file.
It looks like Code is stuck at "Installing .NET Interactive version 1.0.131001...Acquiring".

@colombod
Copy link
Member

colombod commented Jun 11, 2020 via email

@alexandair
Copy link
Contributor Author

Yes.

On one machine, I have .NET Interactive installed (manually, before I tried notebook in Code) and I use .NET notebooks with Azure Data Studio.

 dotnet tool list -g
Package Id                        Version         Commands
--------------------------------------------------------------------
microsoft.dotnet-interactive      1.0.115407      dotnet-interactive

On another machine, I don't have either Azure Data Studio or .NET Interactive installed.

Both machines behave the same and Code Insiders cannot start .NET notebooks.

@jonsequitur
Copy link
Contributor

@alexandair Could you run dotnet --info and post the output?

Thanks.

@alexandair
Copy link
Contributor Author

PS C:\Users\aleksandar> dotnet --info
.NET Core SDK (reflecting any global.json):
 Version:   3.1.100
 Commit:    cd82f021f4

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.18363
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\3.1.100\

Host (useful for support):
  Version: 3.1.0
  Commit:  65f04fb6db

.NET Core SDKs installed:
  2.1.607 [C:\Program Files\dotnet\sdk]
  2.2.203 [C:\Program Files\dotnet\sdk]
  2.2.207 [C:\Program Files\dotnet\sdk]
  3.1.100 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download
PS C:\Users\aleksandar>

@jonsequitur
Copy link
Contributor

Could you try installing .NET Core SDK 3.1.200 or later?

@alexandair
Copy link
Contributor Author

I've installed SDK 3.1.301. The problem remains.

image

@alexandair
Copy link
Contributor Author

I've manually installed version '1.0.131105'.
Tool 'microsoft.dotnet-interactive' was successfully updated from version '1.0.115407' to version '1.0.131105'.
.NET Interactive notebooks in Azure Data Studio recognize and use this version, but VSCode is still not aware of it. Where does Code expect to find .NET Interactive tool?

@brettfo
Copy link
Member

brettfo commented Jun 15, 2020

@alexandair The extension always manages its own version of the dotnet-interactive tool, so the globally installed one won't take effect.

Is the .dib file already open when VS Code launches or are you opening the file fresh after the launch?

@alexandair
Copy link
Contributor Author

@brettfo I've tried both--with .dib file already open and with freshly opened. Both failed to trigger notebook interface.

Where can I see the command that extension is using to install dotnet-interactive tool? Is it implemented as a task?

This is the command I need to use to install it manually because I have some sources in Azure DevOps that need credentials and I'm afraid that --ignore-failed-sources is missing in your command and that's the reason why downloading of the tool is stucked.

dotnet tool update -g Microsoft.dotnet-interactive --add-source https://dotnet.myget.org/F/dotnet-try/api/v3/index.json --ignore-failed-sources

@brettfo
Copy link
Member

brettfo commented Jun 15, 2020

Good find. The tool is installe here. I'll add --ignore-failed-sources to the args.

@brettfo
Copy link
Member

brettfo commented Jun 15, 2020

Created #541.

@alexandair
Copy link
Contributor Author

@brettfo
I've updated my local commands.js with --ignore-failed-sources line and successfully installed the tool.
Annotation 2020-06-15 225303
That output should be more verbose, especially because the installation process was long. Also, with just that first line it was very hard for me to debug it and find the problem.

Now, I can finally see the notebook interface when I load a .dib file.
I can add the code and markdown cells. However, if I run my PowerShell cells, I only see the timer running, but nothing happens. There is no output. And, "Execute notebook (run all cells)" command doesn't even start.

@brettfo
Copy link
Member

brettfo commented Jun 15, 2020

@alexandair The "run all" functionality was just implemented a few hours ago and isn't yet available. Once we get a full build out we'll publish another version that'll fix that scenario. As for the PowerShell issue can you try two separate scenarios for me?

  1. In a PowerShell cell (i.e., in the bottom right of the cell, set the option to "PowerShell (.NET Interactive)") Execute the following:
    1+1
    The expected output is obviously 2.
  2. In a C# cell ("C# (.NET Interactive)"), execute the following:
    #!pwsh
    1+1
    

In the first instance, the code is passed directly to PowerShell; in the second it goes through one more routing step. I'm just curious to see if that gets us better error information.

@alexandair
Copy link
Contributor Author

@brettfo
Both scenarios are failing. Only timers run in both cases.
Also, "Cancel execution" button doesn't work.

@brettfo
Copy link
Member

brettfo commented Jun 16, 2020

We currently don't respond to cell cancellation, so that's expected.

We just published a new version of the tool. Can you update and try the 1+1 scenarios in (1) a C# cell, (2) a C# cell, but under a #!pwsh directive, and (3) a PowerShell cell? If it's still not working can you create a new issue? It'll be easier for us to track it as a separate issue to ensure it doesn't get lost.

@alexandair
Copy link
Contributor Author

@brettfo I've updated the extension and this is the result now:
image

@colombod
Copy link
Member

colombod commented Jun 16, 2020

@alexandair the 1 + 1 should not be on the line as the #!pwsh directive.
That’s directive is instructing the engine to execute the expressions in the cell as powershell
code

@alexandair
Copy link
Contributor Author

Thank you, @colombod

Here is an updated screenshot. It looks like repeating execution is much faster, especially for the PowerShell cell (5.1s vs. 0.1s).
image

@colombod
Copy link
Member

Each language kernel is initialised in lazy fashion. The first submission might include bootstrapping logic that is why I might see faster times on the next submissions. Glad to see the issue is resolved. Thank you

@eosfor
Copy link

eosfor commented Aug 26, 2020

Hi @brettfo , still fails for me. installed VSCode insiders and the extension today 8/25. I have this in the commands.js, so it seems that it includes the update.

image

however, opening the .dib file leads to

image

and there are no any outputs here

image

@alexandair
Copy link
Contributor Author

I can confirm that it fails for me as well on some other machine. I have latest versions of both Code Insiders and the extension.

@alexandair
Copy link
Contributor Author

I didn't have .NET 3.1 SDK installed on that machine.
Shouldn't that step be a part of https://github.com/dotnet/interactive/blob/main/src/dotnet-interactive-vscode/README.md

/cc @colombod @jonsequitur

@eosfor
Copy link

eosfor commented Aug 26, 2020

cool, it is working now, almost :) but now VSCode just hangs on this piece

image

like this

image

@jonsequitur
Copy link
Contributor

I didn't have .NET 3.1 SDK installed on that machine.
Shouldn't that step be a part of https://github.com/dotnet/interactive/blob/main/src/dotnet-interactive-vscode/README.md

Thanks for pointing it out. I've updated it.

@jonsequitur
Copy link
Contributor

@eosfor I've opened #730 to track the PowerShell-related crash. Thanks for reporting it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants