Closed johngardner58work closed 1 month ago
I've run into this before as well when trying to use a using declaration for an instance of IDbConnection
. Not an expert, but it looks like this might be upstream in Rosyln. If I had to guess the implicit block/scope involved doesn't fit well into the script dialect's syntax tree.
Not what you were looking for, but these are the most closely related issues I came across
https://github.com/dotnet/roslyn/issues/16452 https://github.com/dotnet/roslyn/issues/4811
Yes, this issue should be opened on the Roslyn repo.
Thanks!
This form of code using var serilog = new Serilog.LoggerConfiguration(); will complain about a missing ";" but compiles fine in Visual Studio. I have to change it to the statement block form: using(var serilog = new Serilog.LoggerConfiguration()) {...} for it to work in interactive. Since the declaration form is part of C# 12 shouldn't C# script support it also?
Which version of .NET Interactive are you using? (In a notebook, run the
#!about
magic command. ):Version: 1.0.522904+cdfa48b2ea1a27dfe0f545c42a34fd3ec7119074
Library version: 1.0.0-beta.24229.4+cdfa48b2ea1a27dfe0f545c42a34fd3ec7119074
Build date: 2024-06-28T23:16:46.5517077Z
Screenshots
If applicable, add screenshots to help explain your problem.