Version Used:
Microsoft (R) Roslyn C# Compiler version 2.2.0.61624
Steps to Reproduce:
(int, int) x;(1,1): error CS8179: Predefined type 'System.ValueTuple`2' is not defined or importedExpected Behavior:
Code should have compiled properly
Actual Behavior:
Code fails
:memo: I believe you can do this if you do the following:
#r "System.ValueTuple.dll"
It would be nice if this was automatic.
It is supposed to be automatic. @weitzhandler What OS do you run on?
@sharwell
I believe you can do this if you do the following...
I tried that, and that error message still appears.
@tmat
It is supposed to be automatic. @weitzhandler What OS do you run on?
I'm on Windows 10 Home ver. 1703 (build 15036.413).
The issue is that within Interactive Window, the live errors showing multiple assembly defined the same ValueTuple type (conflict with System.ValueTuple, and mscorlib), But you can execute the code without any compilation error.
@weitzhandler I suspect you have .NET Framework 4.7 installed on that machine. Could you confirm?
That said, the EE and scripting hosts are supposed to tolerate such duplicate types (https://github.com/dotnet/roslyn/pull/17192). Not sure what is the problem.
@jcouv
.NET 4.7 is on my machine, and I know that because I have 4.7 templates in VS.
@sharwell @tmat @mazhou-msft @jcouv
I can't get tuples to work in the interactive window at all.
Here's the my console text:
> #reset
Resetting execution engine.
Loading context from 'CSharpInteractive.rsp'.
> #r "System.ValueTuple.dll"
> (int, int) x;
(1,1): error CS8179: Predefined type 'System.ValueTuple`2' is not defined or imported
>
Fixed by #21851 as part of 15.5
Confirmed that works.
Most helpful comment
Confirmed that works.