interactive: Stuck on installing .Net interactive

Type: Question

  1. Install C# Dev Kit and Polyglot notebooks extension;
  2. Open command center, select “Ployglot :Create new blank notebook”;
  3. Error dialog appears:
Command 'Ployglot Notebook: Create new blank notebook  ' resulted in an error ,
command 'polyglot-notebook.newNotebookNoDefaults' not found

Extension Log:

Extension started for VS Code Stable.
tool-uninstall: Executing [dotnet tool uninstall Microsoft.dotnet-interactive] in 'c:\Users\player\AppData\Roaming\Code\User\globalStorage\ms-dotnettools.dotnet-interactive-vscode'.
tool-uninstall: Finished with code 0.
tool-uninstall: STDOUT:
Tool 'microsoft.dotnet-interactive' was successfully uninstalled and removed from manifest file c:\Users\player\AppData\Roaming\Code\User\globalStorage\ms-dotnettools.dotnet-interactive-vscode\.config\dotnet-tools.json.
tool-install: Executing [dotnet tool install --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json --ignore-failed-sources Microsoft.dotnet-interactive --version 1.0.446104] in 'c:\Users\player\AppData\Roaming\Code\User\globalStorage\ms-dotnettools.dotnet-interactive-vscode'.
tool-install: Finished with code 1.
tool-install: STDERR:
Unhandled exception: System.UnauthorizedAccessException: Access to the path 'C:\Users\player\.dotnet\toolResolverCache\1\microsoft.dotnet-interactive' is denied.
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.File.OpenHandle(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
   at Microsoft.DotNet.ToolPackage.LocalToolsResolverCache.Save(IDictionary`2 restoredCommandMap)
   at Microsoft.DotNet.Tools.Tool.Install.LocalToolsResolverCacheExtensions.SaveToolPackage(ILocalToolsResolverCache localToolsResolverCache, IToolPackage toolDownloadedPackage, String targetFrameworkToInstall)
   at Microsoft.DotNet.Tools.Tool.Install.ToolInstallLocalCommand.Install(FilePath manifestFile)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.DotNet.Cli.Parser.<>c__DisplayClass17_0.<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass11_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__17_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass15_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass7_0.<<UseExceptionHandler>b__0>d.MoveNext()
Error acquiring dotnet-interactive tool: undefined

Modes:

App and Extension Info

dotNet Interactive extension version: 1.0.4461040 VS Code version: Code 1.83.0 (e7e037083ff4455cf320e344325dacb480062c3c, 2023-10-03T16:12:16.321Z) OS version: Windows_NT x64 10.0.22621

Extension list
  • GitHub.github-vscode-theme
  • ms-dotnettools.csdevkit
  • ms-dotnettools.csharp
  • ms-dotnettools.dotnet-interactive-vscode
  • ms-dotnettools.vscode-dotnet-runtime
  • ms-dotnettools.vscodeintellicode-csharp
  • ms-python.python
  • ms-python.vscode-pylance
  • ms-toolsai.jupyter
  • ms-toolsai.jupyter-keymap
  • ms-toolsai.jupyter-renderers
  • ms-toolsai.vscode-jupyter-cell-tags
  • ms-toolsai.vscode-jupyter-slideshow
  • ms-vscode.Theme-MaterialKit
  • SumitSaha.learn-with-sumit-theme
System Info
Item Value
CPUs Intel® Core™ i5-10210U CPU @ 1.60GHz (8 x 2112)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) undefined
Memory (System) 15.76GB (10.13GB free)
Process Argv –crash-reporter-id 62384e17-f9d1-4d78-b095-6b26fa04322a
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscoreces:30445986
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
pythonvs932:30410667
py29gd2263:30792226
vsclangdc:30486549
c4g48928:30535728
dsvsc012cf:30540253
pynewext54:30695312
azure-dev_surveyone:30548225
282f8724:30602487
f6dab269:30613381
a9j8j154:30646983
showlangstatbar:30737416
0bi6i642:30841073
03d35959:30757346
pythonfmttext:30731395
fixshowwlkth:30771522
showindicator:30805244
pythongtdpath:30769146
i26e3531:30792625
pythonnosmt12:30797651
pythonidxpt:30805730
pythonnoceb:30805159
copilotsettingc:30839828
synctok:30821570
dsvsc013:30795093
dsvsc014:30804076
diffeditorv2:30821572
pythonmhint1:30842940
dsvsc015:30845448

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 19 (2 by maintainers)

Most upvoted comments

@worthapenny The latest release requires .NET 9.

✅ Confirmed Fixed. Installing the .NET 9 resolved the issue.

Download the .NET 9 from: https://dotnet.microsoft.com/en-us/download/dotnet/9.0

In my case, the issue was related to Nuget. In the package source, I have multiple Nuget repos, some require authentication. Even if I try to update dotnet-interactive as @gmartinka mentioned, I would get an exception. The update tries to access the private Nuget repos, even if I set which repo should be used.

dotnet tool update --ignore-failed-sources --global Microsoft.dotnet-interactive --add-source https://api.nuget.org/v3/index.json

The solution: I’ve temporarily removed all custom Nuget repos from the NuGet.Config and rerun the update. In my case I just unchecked them in Rider.

C:\Users\<user>\AppData\Roaming\NuGet\NuGet.Config

update: I’ve added --ignore-failed-sources argument to the command

https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-tool-update

After running dotnet tool update --global Microsoft.dotnet-interactive and restarting Code, my notebooks are working again!

I guess there must have been a problem with updating via Code, I don’t know why though.

@worthapenny The latest release requires .NET 9.

I was in a similar situation, but with no error dialog showing at all. Trying to create a notebook just failed silently after choosing the default language, and trying to open an existing notebook would load forever.

Turns out I was missing the required dotnet 8.0 SDK, and had only installed the 9.0 SDK as part of an introductory course on F#. My bad, but not getting any feedback from the VS Code extension sure was confusing.