You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AngouriMath.Interactive hangs the C# kernel when it loads #2108
In a C# notebook, #r "nuget:AngouriMath.Interactive, *-*" never returns: the cell runs until the kernel is interrupted. Found while making the sample notebooks run in the Binder image (#2107).
Measured with jupyter nbconvert --execute in that image, which has dotnet-interactive 1.0.712001 and the .NET 10 SDK:
C# cell
result
1 + 1
2, in 3 s
#r "nuget:PeterO.Numbers, 1.8.0"
loads, in 4 s
#r "nuget:AngouriMath, *-*"
loads with its LaTeX extension, in 5 s
#r "nuget:AngouriMath.Interactive, *-*"
still running at 120 s, and at 300 s
The same reference from an F# kernel loads in 14 s. So the hang is in what AngouriMath.Interactive does when the C# kernel loads it, most likely its F# IKernelExtension; I have not narrowed it further. #2107 points the C# sample at AngouriMath, which is all it needs.
Narrowed in the Binder image (dotnet-interactive 1.0.712001). I loaded local builds from a local feed into a C# kernel, changing one thing in each:
variant
C# kernel
F# kernel
2.6.0 as published, and an unchanged local build
hangs
loads
OnLoadAsync without its printfn
hangs
—
OnLoadAsync doing nothing at all
hangs
—
AngouriMath's extension.dib left out of its package
hangs
loads
built against Microsoft.DotNet.Interactive 1.0.0-beta.26120.1, the host's own, instead of 23611.1
hangs
loads
the DLL not packed a second time under interactive-extensions/dotnet
loads, with LaTeX from extension.dib
fails: Could not load file or assembly 'FSharp.Core, Version=10.1.0.0'
Every dependency of the package loads in a C# kernel on its own, and so do all of them together.
So neither what the extension does nor which interface version it was built against causes the hang. Its presence under interactive-extensions/dotnet does: there, a C# kernel never finishes loading it. While it hangs, dotnet-stack shows the kernel's scheduler thread in KernelScheduler.RunDeferredOperationsAndThen, blocked in Task.WaitAny, so the #r command is waiting on an operation deferred to the same kernel.
Dropping that copy fixes C# and breaks F#. A fix has to keep the extension for F# and not offer it to C#. A note for whoever picks this up: in an F# kernel the host logs Loading extensions from …/lib/netstandard2.1/AngouriMath.Interactive.dll, not the interactive-extensions copy.
Until then, a C# notebook needs only #r "nuget:AngouriMath, *-*", whose extension.dib gives LaTeX output. The samples do that since #2107.
A correction to my comment above: the copy under interactive-extensions/dotnet went with the hang but did not cause it.
The packages were built against FSharp.Core 10.1, and the host runs 10.0. With FSharp.Core 8.0.403, the same package layout loads in a C# kernel in 12 s and still works in F#. Rebuilt at 10.1, it times out again in the same image. So the extension doesn't need to be kept from C#. #2112 has the fix and the measurements.
Activity
Rafael-SOWNet commentedon Oct 24, 2026
Narrowed in the Binder image (
dotnet-interactive1.0.712001). I loaded local builds from a local feed into a C# kernel, changing one thing in each:OnLoadAsyncwithout itsprintfnOnLoadAsyncdoing nothing at allextension.dibleft out of its packageMicrosoft.DotNet.Interactive1.0.0-beta.26120.1, the host's own, instead of 23611.1interactive-extensions/dotnetextension.dibCould not load file or assembly 'FSharp.Core, Version=10.1.0.0'Every dependency of the package loads in a C# kernel on its own, and so do all of them together.
So neither what the extension does nor which interface version it was built against causes the hang. Its presence under
interactive-extensions/dotnetdoes: there, a C# kernel never finishes loading it. While it hangs,dotnet-stackshows the kernel's scheduler thread inKernelScheduler.RunDeferredOperationsAndThen, blocked inTask.WaitAny, so the#rcommand is waiting on an operation deferred to the same kernel.Dropping that copy fixes C# and breaks F#. A fix has to keep the extension for F# and not offer it to C#. A note for whoever picks this up: in an F# kernel the host logs
Loading extensions from …/lib/netstandard2.1/AngouriMath.Interactive.dll, not theinteractive-extensionscopy.Until then, a C# notebook needs only
#r "nuget:AngouriMath, *-*", whoseextension.dibgives LaTeX output. The samples do that since #2107.🤖 Generated with Claude Code
https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
Rafael-SOWNet commentedon Oct 24, 2026
A correction to my comment above: the copy under
interactive-extensions/dotnetwent with the hang but did not cause it.The packages were built against FSharp.Core 10.1, and the host runs 10.0. With FSharp.Core 8.0.403, the same package layout loads in a C# kernel in 12 s and still works in F#. Rebuilt at 10.1, it times out again in the same image. So the extension doesn't need to be kept from C#. #2112 has the fix and the measurements.
🤖 Generated with Claude Code
https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
Pin the patched System.Text.Json under the notebook extension (#2116)