1

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, I'm at a loss about what's happening. Can you make sense of it?

#r "nuget:System.Text.Json"
var t = "ttt";
var x = new { t };
System.Console.WriteLine(JsonSerializer.Serialize(x));

enter image description here

Cheers

Guru Stron
  • 102,774
  • 10
  • 95
  • 132
baouss
  • 1,312
  • 1
  • 22
  • 52
  • https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry#authenticating-to-github-packages – Hans Passant Nov 17 '21 at 16:30
  • Thanks, I'm still unsure on why that message pops up in the first place? I am not doing something concerning github – baouss Nov 17 '21 at 20:10

1 Answers1

2

You don't need to install nuget for System.Text.Json just add using System.Text.Json; to the top of your file instead of nuget import:

using System;
using System.Text.Json;
var t = "ttt";
var x = new { t };
Console.WriteLine(JsonSerializer.Serialize(x));
Guru Stron
  • 102,774
  • 10
  • 95
  • 132