首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >C#交互无法识别ValueTuple引用

C#交互无法识别ValueTuple引用
EN

Stack Overflow用户
提问于 2017-07-25 22:25:47
回答 1查看 1.1K关注 0票数 1

我不能在C#交互窗口中使用元组;我得到以下错误:

代码语言:javascript
复制
(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程序集的引用之后也是如此:

代码语言:javascript
复制
#r "D:\MyProject\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll"

如何使用C#交互窗口中的值元组?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-07-25 23:01:18

Remove /r:System.ValueTuple.dll来自

代码语言:javascript
复制
C:\Program Files (x86)\Microsoft Visual Studio\2017\<edition>\Common7\IDE\CommonExtensions\Microsoft\ManagedLanguages\VBCSharp\InteractiveComponents\CSharpInteractive.rsp

适用于Visual Studio 2017和

代码语言:javascript
复制
C:\Program Files (x86)\Microsoft Visual Studio\2017\<edition>\MSBuild\15.0\Bin\Roslyn\csi.rsp

对于命令行工具(csi.exe)

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45306204

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档