Enable C#12#3338
Conversation
|
using declaration not supported only using statements. Get Error: (4,22): error CS1002: ; expected using Microsoft.Extensions.Logging; using ILoggerFactory factory = LoggerFactory.Create(builder => builder.AddConsole().SetMinimumLevel(LogLevel.Information)); logger.LogTrace("Trace message"); |
|
Using statement are not supported in csharp scripting, they won't work |
|
@johngardner58work Is it your expectation that disposal would happen when the kernel is shut down (i.e. when you restart it or close the notebook)? If so you can do this: Microsoft.DotNet.Interactive.Kernel.Root.RegisterForDisposal(factory); |
|
@colombod Using statement in block form does work, not the using declaration form. I don't see why Csharp scripting would care which. Perhaps I should repost for Csharp scripting? if (...) // this does not work // NOT Equivalent in C# script but DOES work |
The place to open this issue would be in dotnet/roslyn. |
Complete .NET8 release with C#12 support