C# Interactive 无法识别 ValueTuple 引用
C# Interactive not recognizing ValueTuple reference
我不能在 C# Interactive 中使用元组 window;我收到以下错误:
(1,15): error CS8137: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference?
(1,15): error CS8179: Predefined type 'System.ValueTuple`2' is not defined or imported
(2,9): error CS0103: The name 'IsLiteralTypeName' does not exist in the current context
(2,47): error CS8179: Predefined type 'System.ValueTuple`2' is not defined or imported
(5,12): error CS8179: Predefined type 'System.ValueTuple`2' is not defined or imported
即使在我添加了对 ValueType 程序集的引用之后也是如此:
#r "D:\MyProject\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll"
如何使用 C# Interactive window 中的值元组?
Remove /r:System.ValueTuple.dll
来自
C:\Program Files (x86)\Microsoft Visual Studio17\<edition>\Common7\IDE\CommonExtensions\Microsoft\ManagedLanguages\VBCSharp\InteractiveComponents\CSharpInteractive.rsp
2017 年 Visual Studio 和
C:\Program Files (x86)\Microsoft Visual Studio17\<edition>\MSBuild.0\Bin\Roslyn\csi.rsp
对于命令行工具 (csi.exe)
我不能在 C# Interactive 中使用元组 window;我收到以下错误:
(1,15): error CS8137: Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference?
(1,15): error CS8179: Predefined type 'System.ValueTuple`2' is not defined or imported
(2,9): error CS0103: The name 'IsLiteralTypeName' does not exist in the current context
(2,47): error CS8179: Predefined type 'System.ValueTuple`2' is not defined or imported
(5,12): error CS8179: Predefined type 'System.ValueTuple`2' is not defined or imported
即使在我添加了对 ValueType 程序集的引用之后也是如此:
#r "D:\MyProject\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll"
如何使用 C# Interactive window 中的值元组?
Remove /r:System.ValueTuple.dll
来自
C:\Program Files (x86)\Microsoft Visual Studio17\<edition>\Common7\IDE\CommonExtensions\Microsoft\ManagedLanguages\VBCSharp\InteractiveComponents\CSharpInteractive.rsp
2017 年 Visual Studio 和
C:\Program Files (x86)\Microsoft Visual Studio17\<edition>\MSBuild.0\Bin\Roslyn\csi.rsp
对于命令行工具 (csi.exe)