-
Notifications
You must be signed in to change notification settings - Fork 390
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
[EXTERNAL] Python kernel with C# cell doesn't execute with C# kernel #1122
Comments
What extension do you have? It seems that the code is sent to a python kernel. Despite the language selected in the cell can you verify that you are using the .NET Interactive kernel by using the command palette and then start looking for the choose kernel command? |
How are you opening the notebook? |
@brettfo do you have any suggestion? |
How I'm opening ? Tutorial https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.dotnet-interactive-vscode |
You typically have to select the kernel before the language chooser will work correctly. The experience is still awkward there. If you're still seeing output from Python instead of .NET, try opening the VS Code command palette, select |
Thank you. So while waiting for the experience to become satisfactory, wouldn't it be wise to add a section in the doc for this kind of problem? |
This has been a major point of confusion for users in the past. The issue appears to be that the Python kernel was selected for the notebook, but the individual cell's language was set to "C# (.NET Interactive)" so editor language services were getting routed to C# appropriately, but cell execution was honoring the kernel. There are two related issues open against the Jupyter extension, microsoft/vscode-jupyter#4510 and microsoft/vscode-jupyter#4490 that call out how a kernel can (and should?) restrict it's language list, so the Python kernel should ideally not list C# as a possible language. |
Describe the bug
Can't execute C# code into ipynb file in vscode stable. But with jupyter-lab I can:
Please complete the following:
Which version of .NET Interactive are you using? There are a few ways to find this out:
1.0.215204
In a notebook, run the
#!about
magic command.Nothing, just say 0.6s
At the command line, run
dotnet interactive --version
.1.0.215204+974732778592b69c526648c54ef4c48219058e97
Screenshots
Linux Distribution
The text was updated successfully, but these errors were encountered: