【发布时间】:2018-11-22 02:59:17
【问题描述】:
当我的文件顶部有这一行时:
using System.Numerics;
我收到以下错误:
Error CS0234: The type or namespace name 'Numerics' does not exist in the namespace 'System' (are you missing an assembly reference?) (CS0234) (CSharpTests)
我文件顶部的其他using 指令,例如using System;,可以正常工作。
我在 Ubuntu 18.04 64 位上使用 Mono 5.12.0.301 和 MonoDevelop 7.5(内部版本 1255)。
我的第一个想法是框架版本被设置为足够老的东西,以至于没有System.Numerics。在Options -> Build -> General中,我的framework版本默认是4.5,改成最新的4.7.1版本并不能让代码生效:
This answer 发现问题出在框架版本过时,但显然我有足够新的框架版本,对吧?
编辑:好的,根据 SushiHangover 的回答,我可以使用 System.Numerics,但实际上我正在尝试使用 System.Numerics.Vectors,我已将其包含在参考文献中:
但是当我使用using System.Numerics.Vectors; 时,我得到了这个错误:
Error CS0234: The type or namespace name 'Vectors' does not exist in the namespace 'System.Numerics' (are you missing an assembly reference?) (CS0234) (CSharpTests)
【问题讨论】:
标签: c# namespaces mono monodevelop