Questions tagged [dotnet-interactive]

.NET Interactive is an engine that can run multiple languages and share variables between them.

As a powerful and versatile engine, .NET Interactive can be used to create and power a number of tools and experiences such as:

  • Polyglot Notebooks
  • s
  • Embeddable script engines

See also

18 questions
7
votes
1 answer

Using Extension methods in RoslynPad or Polyglot notebooks

I try to understand an extension method similar to this code var p = new Person("Tim"); p.LastName = "Meier"; // reader.Get("IsDerivat"); var IsOlivia = p.Get("Olivia"); This is my code inside RoslynPad: public static class…
surfmuggle
  • 5,527
  • 7
  • 48
  • 77
5
votes
1 answer

how to draw images in a .NET Interactive notebook (C#, VS Code)

I'm trying to draw simple graphics in the .NET Interactive Notebook, using C#. Kind of like a C# version of Dr. Racket. The simplest thing I've seen so far is using System.Drawing (SFML.NET, Raylib-cs work too, but they open up a window to show…
user1026169
  • 5,345
  • 5
  • 21
  • 35
3
votes
1 answer

How to include project references in .NET Interactive Notebooks?

Using NET 6 I have the following project structure: nuget.config project.code-workspace - Core Core.csproj - Api Api.csproj - Sim notebook.ipynb Where notebook.ipynb is for now just: #i "nuget:https://api.nuget.org/v3/index.json" #r…
Miguel Moura
  • 36,732
  • 85
  • 259
  • 481
3
votes
1 answer

Cannot plot inline plotly charts in Jupyter Notebook using C#

Hello I am trying to plot a chart in Jupyter Notebook. I have been following this tutorial. I am using the following nuget packages to read a data and then plot it using plotly So I have this block of code which produces a scatter plot, var chart =…
Murtaza
  • 413
  • 1
  • 3
  • 13
2
votes
1 answer

Display Mermaid diagram from C# variable in Polyglot notebook

I know that Polyglot notebooks support Mermaid diagrams. But it doesn't support veriable sharing. Suppose I have diagram code in C# string variable. Are there any possibility to display that string as diagram? Example: // below diagram code was…
2
votes
0 answers

How to use a manually installed .NET SDK in Polyglot Notebook

I am trying to use Polyglot Notebooks in VS Code. I am on a corporate computer that only has Dotnet SDK 5.0 installed, and I do not have admin privileges. I have downloaded the binaries for the most recent version of .NET 7 and unzipped them into a…
2
votes
1 answer

Adjust runtime identifier of .NET Interactive Notebook

I have a legacy assembly that is still on .NET Framework 4.8 and references System.Windows.Forms.dll (for non-UI reasons, actually) and I would like to use it inside a .NET Interactive Notebook through also existing code that loads this assembly…
Georg
  • 5,626
  • 1
  • 23
  • 44
2
votes
1 answer

vscode .net interactive notebooks to display latex

I have been looking for a way to display latex in vscode .Net interactive notebooks, but I've had no luck. on my C# .Net interactive Code Cell I have #r "nuget: AngouriMath.Interactive, 1.3.0" using AngouriMath.Interactive; using AngouriMath; Entity…
2
votes
1 answer

.NET Interactive - how to change collection output size

I'm using .NET Interactive notebook inside VS Code and want to change the number of printed out elements: var x = Enumerable.Range(0,21); x.Display(); Only first 20 element are shown in the the output: Can I somehow increase the size of output?
2
votes
2 answers

Deedle in dotnet interactive

Context If I enter the following: #r "nuget:Deedle" #r "nuget:FSharp.Charting" open System open Deedle open FSharp.Charting let dates = [ DateTime(2013, 1, 1); DateTime(2013, 1, 4); DateTime(2013, 1, 8); ] let values = [ 10.0; 20.0;…
dharmatech
  • 8,979
  • 8
  • 42
  • 88
1
vote
2 answers

How to use LINQ in a .dib Polyglot notebook?

I'm trying to use LINQ in a C# (Polyglot Notebook). using System.Linq; Environment.GetEnvironmentVariables().Values.Select(x => x) But I'm getting the error: Error: (3,46): error CS1061: 'ICollection' does not contain a definition for 'Select'…
Kees C. Bakker
  • 32,294
  • 27
  • 115
  • 203
1
vote
0 answers

Vscode .net interactive notebooks hide code when exporting to HTML

How do I hide the code cell when exporting .net interactive notebooks in visual studio code? For instance, I'd like to export the output, which is the latex display part of the example above, while excluding the actual code cell from being…
1
vote
1 answer

Equivalent of `shift` from pandas

Initial DataFrame in Pandas Let's suppose we have the following in Python with pandas: import pandas as pd df = pd.DataFrame({ "Col1": [10, 20, 15, 30, 45], "Col2": [13, 23, 18, 33, 48], "Col3": [17, 27, 22, 37, 52] }, …
dharmatech
  • 8,979
  • 8
  • 42
  • 88
1
vote
1 answer

NET interactive notebook, cannot use System.Text.Json

I am evaluating NET interactive notebooks. I downloaded the VS code extension and created a dib notebook file. Following this example on how to include packages, I am getting a 401 unauthenticated response when trying to use System.Text.Json... Tbh,…
baouss
  • 1,312
  • 1
  • 22
  • 52
1
vote
0 answers

How to clear .NET interactive cell output programmatically

When a cell that contains referencing statements such as #r "nuget: FSharp.Data, 4.1.1" the cell automatically prints to output something like the following Installed Packages - Deedle, 2.3.0 - fsharp.core, 5.0.0 - ... Which can be very long…
ozgur
  • 2,549
  • 4
  • 25
  • 40
1
2