question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Some commands (GIT , AZ) hang when using the dotnet interactive kernel in VS Code but are OK with the .net(powershell) on in VSCode or Jupyter.

See original GitHub issue

This may need to be logged as a VSCode problem, but because the behaviour seems to be different between two dotnet interactive kernels I’m starting here

Describe the bug

An advantage of having PowerShell as a supported environment in notebooks the ability to run any command line and capture its output. For example a powershell cell can contain

ping  localhost

I have been been using this to create a shared notebook of useful git examples. With combination of anaconda / Jupyter and the .NET (PowerShell) kernel,

git status

and similar work. Doing the same in VSCode fails with the default kernel. The command will hang indefinitely, and usually clicking the stop button returns
Error: System.OperationCanceledException: Command :SubmitCode: git status cancelled. but I have seen this return the output (rarely).
But I can switch kernels and get it to work. (See screen shots.) I’d like to use the notebooks on machines without the python / jupyter bits (only with VSCode) so this is only a partial solution.

It does not affect all commands “Net share” , “ping”, “Ipconfig” “nslookup google.com”, “Tasklist” all work, so Initially I thought this was something specific to git.exe but “az -h” has the same problem

I’ve also tried running the command as a job with Start-Job {git status} | wait-job | receive-job but this gives the error

Start-Job: The pwsh executable cannot be found at "C:\Users\P10506111\.nuget\packages\microsoft.dotnet-interactive\1.0.240403\tools\net5.0\any\runtimes\win\lib\net5.0\pwsh.exe".
Note that 'Start-Job' is not supported by design in scenarios where PowerShell is being hosted in other applications.

And by trying to remote to a PSSession on my machine with
$pss = New-PSSession -ComputerName localhost -EnableNetworkAccess gives
New-PSSession: [localhost] An error has occurred which PowerShell cannot handle. A remote session might have ended.

From the message the first looks to be by design, I can’t tell if the second is design, bug or user error - they fail in both kernels. I have also tried creating a PS Runspace to run the command in the default kernel - no joy with that either.

Please complete the following:

Which version of .NET Interactive are you using? There are a few ways to find this out: Version: 1.0.240403+56a0e392fba305af06e72ce7dec885b2b6722c00 Build date: 2021-08-09T11:46:14.5291024Z

  • OS
    • Windows 10
  • Browser
    • Edge
  • Frontend
    • Jupyter Notebook
    • Visual Studio Code
    • Visual Studio Code Insiders

##Screenshots

image

image

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
jonsequiturcommented, Aug 24, 2021

This looks to me like a VS Code messaging issue. The command appears to complete once you trigger another command, e.g. running another cell or even hovering somewhere that triggers a hover text request:

issue 1546

@brettfo

1reaction
daxian-dbwcommented, Aug 22, 2021

@jonsequitur No, not sure what is going on. I tried with Jupyter notebook + latest stable version of Microsoft.dotnet-interactive global tool, and git status does work in it. What are the differences between dotnet-interactive running in VSCode and in Jupyter notebook?

@dfinke How did you install .NET Interactive Notebook in GitHub codespace? It says “not available in VS Code Web” for me:

image


Read more comments on GitHub >

github_iconTop Results From Across the Web

Working with Jupyter code cells in the Python Interactive ...
Using the Python Interactive window​​ To use the window as a console, open it with the Jupyter: Create Interactive Window command from the...
Read more >
Exploring .NET interactive notebooks with VS Code
In this post I explore .NET Interaction Notebooks for VS Code, discuss the options, and show how to get started.
Read more >
.NET Interactive with SQL!| .NET Notebooks in Visual ...
To change the language in a cell, you can either use a magic command in Jupyter (e.g. #!sql ) or the VS Code...
Read more >
Creating PowerShell Notebooks with .NET Interactive ...
In this video, we'll look at how to install and use . NET Interactive Notebooks in Visual Studio code with PowerShell.
Read more >
Making Sense of the Metadata: Clustering 4000 ...
How would you group more than 4,000 active Stack Overflow tags into meaningful groups? This is a perfect task for unsupervised learning and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found