Skip to content

Exception when using .NET Polyglot Notebook due to strong naming #433

@dibenzepin

Description

@dibenzepin

Description

When I make a minimal C#/F# notebook, it fails to render under the cell when the chart is the last variable. However when Chart.Show() is called, it opens fine in a browser window.

Repro steps

  1. Download the Polyglot Notebooks extension

  2. Make a new .ipynb file

  3. Add the following cells:

    --------------------------------- 
    #r "nuget: Plotly.NET.Interactive"
    #r "nuget: Plotly.NET.CSharp"
    ---------------------------------
    let xData' = [ 0. .. 10. ]
    let yData' = [ 0. .. 10. ]
    Chart.Point(xData', yData')
    ---------------------------------
    using Plotly.NET.CSharp;
    
    Chart.Point<int, int, string>(
        x: Enumerable.Range(0,11),
        y: Enumerable.Range(0,11)
    )
    

Expected behavior

The chart is rendered under both cells.

Actual behavior

An exception is thrown:

{
	"name": "Error",
	"message": "System.IO.FileNotFoundException: Could not load file or assembly 'Giraffe.ViewEngine.StrongName, Version=2.0.0.0, Culture=neutral, PublicKeyToken=028aa8e2a326f4d0'. The system cannot find the file specified.

File name: 'Giraffe.ViewEngine.StrongName, Version=2.0.0.0, Culture=neutral, PublicKeyToken=028aa8e2a326f4d0'
   at Plotly.NET.Interactive.Formatters.toInteractiveHTML(GenericChart gChart)
   at <StartupCode$Plotly-NET-Interactive>.$Extension.Microsoft-DotNet-Interactive-IKernelExtension-OnLoadAsync@16.Invoke(GenericChart chart, TextWriter writer)
   at Microsoft.DotNet.Interactive.Formatting.Formatter.<>c__DisplayClass46_0`1.<Register>b__0(Object value, FormatContext context) in D:\\a\\_work\\1\\s\\src\\Microsoft.DotNet.Interactive.Formatting\\Formatter.cs:line 427
   at Microsoft.DotNet.Interactive.Formatting.Formatter`1.FormatTo(T obj, FormatContext context, String mimeType) in D:\\a\\_work\\1\\s\\src\\Microsoft.DotNet.Interactive.Formatting\\Formatter{T}.cs:line 86
   at Microsoft.DotNet.Interactive.Formatting.Formatter.ToDisplayString(Object obj, String mimeType) in D:\\a\\_work\\1\\s\\src\\Microsoft.DotNet.Interactive.Formatting\\Formatter.cs:line 281
   at Microsoft.DotNet.Interactive.FormattedValue.<>c__DisplayClass12_0.<CreateManyFromObject>b__0(String mimeType) in D:\\a\\_work\\1\\s\\src\\Microsoft.DotNet.Interactive\\FormattedValue.cs:line 49
   at System.Linq.Enumerable.SelectArrayIterator`2.ToArray()
   at Microsoft.DotNet.Interactive.CSharp.CSharpKernel.Microsoft.DotNet.Interactive.IKernelCommandHandler<Microsoft.DotNet.Interactive.Commands.SubmitCode>.HandleAsync(SubmitCode submitCode, KernelInvocationContext context) in D:\\a\\_work\\1\\s\\src\\Microsoft.DotNet.Interactive.CSharp\\CSharpKernel.cs:line 335
   at Microsoft.DotNet.Interactive.Kernel.HandleAsync(KernelCommand command, KernelInvocationContext context) in D:\\a\\_work\\1\\s\\src\\Microsoft.DotNet.Interactive\\Kernel.cs:line 331
   at Microsoft.DotNet.Interactive.KernelCommandPipeline.<BuildPipeline>b__6_0(KernelCommand command, KernelInvocationContext context, KernelPipelineContinuation _) in D:\\a\\_work\\1\\s\\src\\Microsoft.DotNet.Interactive\\KernelCommandPipeline.cs:line 60
   at Microsoft.DotNet.Interactive.KernelCommandPipeline.SendAsync(KernelCommand command, KernelInvocationContext context) in D:\\a\\_work\\1\\s\\src\\Microsoft.DotNet.Interactive\\KernelCommandPipeline.cs:line 51"
}

Known workarounds

Don't display the cell output in the cell, call .Show() to open it in a browser

Related information

  • Operating system: macOS Monterey 12.7
  • Branch: Stable
  • .NET Runtime, CoreCLR or Mono Version: 7.0.401
  • Performance information, links to performance testing scripts: N/A

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions