Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
找不到C#ArgumentNullException类型或命名空间。VS代码_C#_Visual Studio Code_Argumentnullexception - Fatal编程技术网

找不到C#ArgumentNullException类型或命名空间。VS代码

找不到C#ArgumentNullException类型或命名空间。VS代码,c#,visual-studio-code,argumentnullexception,C#,Visual Studio Code,Argumentnullexception,我的代码的一部分: public void Move(Point newLocation) { if (newLocation == null) throw new ArgumentNullException("newLocation"); Move(newLocation.X, newLocation.Y); } 我认为这是一个错误: public void Move(Point newLocation)

我的代码的一部分

 public void Move(Point newLocation)
    {
        if (newLocation == null)
            throw new ArgumentNullException("newLocation");

        Move(newLocation.X, newLocation.Y);
    }
我认为这是一个错误

 public void Move(Point newLocation)
    {
        if (newLocation == null)
            throw new ArgumentNullException("newLocation");

        Move(newLocation.X, newLocation.Y);
    }
找不到类型或命名空间名称“ArgumentNullException”(您是否缺少using指令或 装配参考?)

我的c代码有问题吗。这可能是VS代码C#支持扩展错误吗

我是c的初学者,请解释一下在“系统”中。因此,要么完全限定名称

throw new System.ArgumentNullException("newLocation");
或添加

using System;
到C#文件或命名空间的顶部