Esoteric error hour
It’s been a while since I ran a google query that returned zero results. It’s quite impressive when that happens. And it just happened to me the other day. I am putting this here in case anyone else runs into the error, or more likely, I will run into this myself a year later and will need a solution.

Context
I was working with a jupyter lab notebook and wanted to run some code I hadn’t run in a few months. Jupyter notebooks are extremely popular, but my setup was a bit more unique: I was using F#/.NET runtime and not Python. After I instructed to execute a cell, I ran into this obscure error that made very little sense:
System.IO.FileNotFoundException: Could not load file or assembly ‘Microsoft.Extensions.Logging.Abstractions, Version=8.0.0.0
I thought that was odd. I reviewed the references, everything looked good. I ran the code outside of Jupyter lab, also ran fine. So it’s something with Jupyter environment. What gives?
Cause for the error
Behind the scenes when you use .NET with Jupyter notebooks, you specify .NET Interactive as a kernel to use. .NET Interactive is a global tool that can be executed in the command line via `dotnet-interactive` command. And it looks like the tool version I was using was built for .net 7 while the code I was trying to execute in the notebook was targeting .net 8!
Exploration of the tooling
Some commands that I ran that helped me to track this issue down were:
- dotnet tool itself, where you can list the tools you have installed. For instance:
PS D:\programming> dotnet tool list --global
Package Id Version Commands
--------------------------------------------------------------------
dotnet-repl 0.1.208 dotnet-repl
dotnet-trace 7.0.421201 dotnet-trace
fantomas-tool 4.7.9 fantomas
microsoft.dotnet-interactive 1.0.506301 dotnet-interactive
Running “dotnet tool list — global” gives you an idea what you have installed on your machine and their versions. Usually a good starting point for troubleshooting.
You can even search for .net tools on nuget.org via command line by running this:
PS D:\programming> dotnet tool search interactive
Package ID Latest Version Authors Downloads Verified
---------------------------------------------------------------------------------------------------------
microsoft.dotnet-interactive 1.0.510102 Microsoft 33421699 x
dotnet-repl 0.1.216 jonsequitur 111939
teamcity.csi 1.0.6 NikolayP,JetBrains 36395
dotnet-csi 1.0.7 NikolayP 10619
microsoft.dotnet-try 1.0.20474.1 Microsoft 30980 x
dotnet-shell 1.0.1.2 dotnet-shell 6305
terramove 0.1.16 Terramove 3399
nupu 1.0.37 ThomasArdal 8524
giteztag 0.5.0 prayzzz & Contributors 2233
fsh 1.0.0 Christopher Pritchard 659
dib2html 1.0.0 Dib2Html 272
csharprepl 0.6.6 Will Fuqua 50662
You can find your tools on nuget.org and see the latest versions available.
Solution
Once I ran some of the commands above I saw that there was a more recent version of .net interactive tool. Checking the release notes I observed that the latest version had targeting of .net 8 as one of the key features and that made me think it was what I needed to get past the issue.
To update, I first restarted jupyter kernel, and then ran the tool update:
PS D:\programming> dotnet tool update --global Microsoft.dotnet-interactive
Skipping NuGet package signature verification.
Tool 'microsoft.dotnet-interactive' was successfully updated from version '1.0.506301' to version '1.0.510102'.
Note that the output above is from my more recent run I did for this blog entry and was not the update that fixed the issue. I had a much bigger version gap then but just didn’t save the output to share with you.
After the update I tried the jupyter notebook again, and voila! Everything worked again.