【发布时间】:2015-06-28 20:34:59
【问题描述】:
我对 Visual Studio 的智能感知有疑问。
每次我在结构中创建C# 静态构造函数时,Visual Studio 的智能感知在尝试调用构造函数时都会中断。
似乎它找不到构造函数,甚至没有默认构造函数。
有谁知道我为什么会遇到这个问题?
public Triangle(int aX, int aY, int bX, int bY, int cX, int cY)
{
A = new Point(aX, bY);
B = new Point(bX, bY);
C = new Point(cX, cY);
}
public Triangle(Point a, Point b, Point c)
{
A = a;
B = b;
C = c;
}
public Triangle(Triangle value)
{
A = value.A;
B = value.B;
C = value.C;
}
static Triangle()
{
Empty = new Triangle(0, 0, 0, 0, 0, 0);
}
【问题讨论】:
-
您能否发布您的静态构造函数的代码。
-
你应该阅读the static constructor。
-
Intellisense 是否可以在其他任何地方工作,重新启动 Studio 和 ReBuild 后问题是否仍然存在?如有疑问,请删除 *.suo 文件并重新启动 VS。
-
智能感知似乎适用于其他任何地方。我已经重新启动了 Visual Studio,甚至删除了 *.suo 文件。当我尝试创建对象时,智能感知没有显示,当我删除静态构造函数时,它显示我的其他构造函数就好了。
-
我也没有,但我没有问题。
标签: c# .net visual-studio-2013 struct static-constructor