0

I have a C# class in Visual Studios2010 that is referencing a globals class in the same namespace. This project is in a solution with several other projects and will build on its own. When I try to build the entire solution it loses reference to the globals class in its own namespace. The weird thing about this is there is another class also using globals in the same namespace and it works just fine.

Things I have tried:

-Changing the framework to every possible option.

-Deleting the class completely cleaning rebuilding restarting my computer etc.

-Making the project the startup project

Any help on this matter would be greatly appreciated I’m chasing my tail at this point.

4

1 回答 1

0

我的猜测是这是一个语法错误。我今天早些时候遇到了类似的错误,并通过修复上述语法错误(特别是删除了一个流氓右花括号)来解决它。如何测试:语法错误不会在上面传播,所以只需在引用 Globals 类有问题的类的开头写一个方法:

public void testGlobals()
{
    Globals testglobals = new Globals(); //or whatever other constructor
}

如果是这样(即类名改变颜色并且没有出现红色波浪线),开始逐个方法向下移动它,直到类名变成全白色(或黑色,如果你进入视网膜破坏配色方案)并且你把红色的波浪线拿回来。然后修复所说的语法错误。

于 2012-08-30T21:57:39.973 回答