dotnet / interactive

.NET Interactive combines the power of .NET with many other languages to create notebooks, REPLs, and embedded coding experiences. Share code, explore data, write, and learn across your apps in ways you couldn't before.
MIT License
2.8k stars 374 forks source link

Raw value storage #3528

Open BodukGenius opened 2 months ago

BodukGenius commented 2 months ago

Describe the bug

I am experiencing a System.NullReferenceException error when attempting to set a value using the #!set magic command in a .NET Interactive notebook. The error occurs when I try to assign a URL value to a variable in the notebook environment. Below is the error message and stack trace provided:

Error: System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.DotNet.Interactive.KeyValueStoreKernel.Microsoft.DotNet.Interactive.IKernelCommandHandler<Microsoft.DotNet.Interactive.Commands.SubmitCode>.HandleAsync(SubmitCode command, KernelInvocationContext context) in D:\a_work\1\s\src\Microsoft.DotNet.Interactive\KeyValueStoreKernel.cs:line 79
at Microsoft.DotNet.Interactive.Kernel.HandleAsync(KernelCommand command, KernelInvocationContext context) in D:\a_work\1\s\src\Microsoft.DotNet.Interactive\Kernel.cs:line 330
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 41

The notebook content where the issue occurred is as follows:

#!meta

{"kernelInfo":{"defaultKernelName":"csharp","items":[{"aliases":[],"name":"csharp"}]}}

#!value

#!set --name url --value https://example.com/

Please complete the following:

Which version of .NET Interactive are you using? (In a notebook, run the #!about magic command. ): Version: 1.0.520801+1e5d205f82c7f5bb1b2e5ce60c680491552cfa23 Library version: 1.0.0-beta.24208.1+1e5d205f82c7f5bb1b2e5ce60c680491552cfa23 Build date: 2024-04-19T23:36:03.3519914Z

Screenshots

If applicable, add screenshots to help explain your problem. Attach files or drag and drop images here. image

jonsequitur commented 2 weeks ago

I'm not able to reproduce this bug. Are you still seeing it?