Roslyn: C# Interactive doesn't support C# 8

Created on 12 Dec 2019  路  3Comments  路  Source: dotnet/roslyn

_This issue has been moved from a ticket on Developer Community._


Please have C# interactive support C# 8.0.

I believe that the whole purpose of the C# interactive compiler is for playing and experimenting with new code.
Lack of support for C# 8 makes the interactive tool completely unusable.

Here鈥檚 a sample console:

Microsoft (R) Visual C# Interactive Compiler version 3.3.1-beta3-19461-02 ()
Loading context from 'CSharpInteractive.rsp'.
Type "#help" for more information.
> var x = new int[] { 1, 2, 3 };
> var a = x[^1];
(1,11): error CS0518: Predefined type 'System.Index' is not defined or imported
(1,11): error CS0656: Missing compiler required member 'System.Index..ctor'
>

Original Comments

Visual Studio Feedback System on 11/27/2019, 11:34 PM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

Visual Studio Feedback System on 12/12/2019, 00:09 PM:

This issue is currently being investigated. Our team will get back to you if either more information is needed, a workaround is available, or the issue is resolved.


Original Solutions

(no solutions)

Area-Interactive Feature Request

Most helpful comment

The Interactive Window now supports running on .NET Core.

Execute the following command to switch to .NET Core host process:

#reset core

Then all C# 8 (and later) features should be available:
image

All 3 comments

The Interactive Window only supports .NET Framework at this point. Hence features are limited to C# 7.3 and lower. Too enable C# 8 we would need to first enable running on Core CLR (see https://github.com/dotnet/roslyn/issues/4788).

@tmat It looks like you recently closed #4788 with this comment:

We are gonna use the Core CLR that are found using VS process environment variables.

How does that impact this issue?

The Interactive Window now supports running on .NET Core.

Execute the following command to switch to .NET Core host process:

#reset core

Then all C# 8 (and later) features should be available:
image

Was this page helpful?
0 / 5 - 0 ratings